I am looking for output of Unix command to be stored in any variable. Generally we use POST process to do so , however , as this is "INCLUDE" object I am not able to store.
PUT_VAR does not work as that stores the command itself - not command output.
1. You may use PREP_PROCESS in the INCLUDE object to run an OS command :
:SET &HND# = PREP_PROCESS("&$AGENT#","UNIXCMD",,"CMD=echo $SHELL","UC_LOGIN=&$LOGIN#")
: SET &SHELL# = GET_PROCESS_LINE(&HND#)
: P &SHELL#
2. You can also use a BACKEND variable to run the command, then collect its output with GET_VAR or PREP_PROCESS_VAR in the include object as well.
:SET &SHELL# = GET_VAR(VARA.BACKEND.UNIX.CMD)
Here's the output:
I'm attaching an xml export of example objects.