Begin execution of an external program. The jkeyauto program will wait until the loaded program completes and cannot be controlled in any other way by the jkeyauto program. The EXECUTE and PERFORM statements provide the same functionality and are synonyms for each other.
The statement executes the program through your default shell, so any meta-characters such as * " > will be treated specially by the shell.
execute|perform expression_perf {capturing variable} {setting variable}
expression_perf shows what program you want to execute.
capturing allows you to optionally specify a variable where the output of the command will be captured. Without this option the output of the command goes to the same terminal output as jkeyauto.
setting allows you to optionally specify a variable which will be set to the exit() code of the executed program. If the program exited due to a signal, then this variable is set to "Snnn" where nnn is the signal number. This setting variable is similar to using the internal $? Variable which also contains the exit() code of the last program executed.
perform "who am i" CAPTURING output SETTING rc
if rc ne 0 then crt "who failed !!" ; exit 0
print "_who am i_ tells me the I am " : output
The result of the execution can also be examined with the $? environment variable which is an internal variable set to the exit code of the last program executed.
perform "LIST MD IF \*A1 \> \'1234\'" SETTING s1
In the above example we don"t want the shell to treat the * > or ' characters as special character, so we use the normal shell convention of preceding them with a back slash to "delimit" the shell meta-characters.
JKEYAUTO