144. OSRExecute

144.1. Summary of Module Globals

List of Global Functions

  • Command - Wrapper to CommandProgress, with the use of current log file

  • CommandOutput - Executes the given commandline in a bash and writes all execution-information to the standard log file. This function returns all output from the commandline in a result map. Use these functions instead of directly calling the SCR or WFM agents (e.g. SCR::Execute(.target.bash_output, "rpm -q lilo") resp. WFM::(.local.bash_output, "rpm -q -r /mnt lilo")) to be sure to support logging correctly.

  • CommandProgress - Executes the given commandline in a bash and writes all execution-information to the specified logfile. Use these functions instead of directly calling the SCR or WFM agents (e.g. SCR::Execute(.target.bash, "rpm -q lilo") resp. WFM::(.local.bash, "rpm -q -r /mnt lilo")) to be sure to support logging correctly.

List of Global Variables

    144.2. Global Functions

    144.2.1. Command

    Wrapper to CommandProgress, with the use of current log file

    Function parameters

    • path environment

    • string commandline

    Return value

    • boolean

    144.2.2. CommandOutput

    Executes the given commandline in a bash and writes all execution-information to the standard log file. This function returns all output from the commandline in a result map. Use these functions instead of directly calling the SCR or WFM agents (e.g. SCR::Execute(.target.bash_output, "rpm -q lilo") resp. WFM::(.local.bash_output, "rpm -q -r /mnt lilo")) to be sure to support logging correctly.

    Function parameters

    • path environment

    • string commandline

    Return value

    • boolean

    144.2.3. CommandProgress

    Executes the given commandline in a bash and writes all execution-information to the specified logfile. Use these functions instead of directly calling the SCR or WFM agents (e.g. SCR::Execute(.target.bash, "rpm -q lilo") resp. WFM::(.local.bash, "rpm -q -r /mnt lilo")) to be sure to support logging correctly.

    Function parameters

    • path environment

    • string commandline

    • string progress_file

    Return value

    • boolean - Success

    Example 26. 

    	OSRExecute::CommandProgress (.local.bash, "rpm -qi -r /mnt/ lilo",
    		"/tmp/progress_file");
    
       $ cat /tmp/osr.log
       *** /bin/rpm -qi lilo ***
       Name      : lilo         Relocations: (not relocateable)
       Version   : 21.6              Vendor: SuSE GmbH, Nuernberg, Germany
       [...]
       SuSE series: a
       *** exit code: 0 ***


    144.3. Global Variables

    144.4. Module Requirements

    144.4.1. Module Imports

    • Mode
    • OSRCommon
    • OSRLogFile
    • OSRProgress

    144.4.2. Module Includes