Le 11/11/2011 17:48, JC S a écrit : > 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@Linux$ BashScript > 24 > $ > " > Which means that it might have line terminating characters as well, > eg. "\n" , but I'm not entirely sure. > > > Thanks! >
The fastest way is using the "EXEC ... TO <variable>" syntax. See the wiki for the details. Regards, -- Benoît Minisini ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user