[tt]
Is it possible to run a script within awk presenting a parsed argument to it?
My work around at present is to print the syntax and any arguments to a file and execute the file outside of the awk statement.
Can the following line be run inside an awk statement:
/opt/itmcmd server -h /opt/ITM start ARG
###Script extract
/opt/IBM/ITM/bin/cinfo -r|nawk -v ARG=$VAL 'BEGIN {
RUNSCRIPT="/tmp/runscript"
FLAG=1 }
$0 ~/running$/{ FLAG=0 }
END { if(FLAG==1) {
printf("%s%s%s\n", "/opt/itmcmd server -h /opt/ITM start"," ",ARG) >RUNSCRIPT }
}'
# Work around solution
/tmp/runscript >/dev/null 2>&1
[/tt]
Is it possible to run a script within awk presenting a parsed argument to it?
My work around at present is to print the syntax and any arguments to a file and execute the file outside of the awk statement.
Can the following line be run inside an awk statement:
/opt/itmcmd server -h /opt/ITM start ARG
###Script extract
/opt/IBM/ITM/bin/cinfo -r|nawk -v ARG=$VAL 'BEGIN {
RUNSCRIPT="/tmp/runscript"
FLAG=1 }
$0 ~/running$/{ FLAG=0 }
END { if(FLAG==1) {
printf("%s%s%s\n", "/opt/itmcmd server -h /opt/ITM start"," ",ARG) >RUNSCRIPT }
}'
# Work around solution
/tmp/runscript >/dev/null 2>&1
[/tt]