[Gambas-user] Getting Feedback from EXEC

JC S 3dwarp at ...626...
Fri Nov 11 17:48:40 CET 2011


Hello all.
I want to use exec to run xterm and a bash script and I want to store
the returned information a some form of string.

something like:
EXEC ["xterm, " - hold ", " - e ", " #! / Bin / bash; MYFCpid = $(ps
ux | awk '/game-engine/ && !/awk/ {print $2}'); if [[ -n $MYFCpid ]];
then ps -p $MYFCpid -o %cpu | sed -n 2p; else echo \"game-engine
instance not found running.\"; fi "]

This *should* return the average CPU use of game-engine as well, in the form of:
"
pc at ...121...$ BashScript
24
$
"
Which means that it might have line terminating characters as well,
eg. "\n" ,  but I'm not entirely sure.


Thanks!




More information about the User mailing list