Capture shell output

P.R. romero619 at HOTMAIL.COM
Sat Jun 13 14:56:08 EDT 2009


Is it possible to capture stdout from a shell command?
Im trying to do the following within a grads script (in a linux shell
environment)?

* use linux shell's 'date' function to process time...
'q time'
tc=subwrd(result,3)
'!date -u -d 'tc' +"%Y%m%d %H%M%S"'

* this doesn't work; result is empty

say 'res: 'result

ymd=subwrd(result,1)
hms=subwrd(result,2)
say 'ymd: 'ymd
say 'hms: 'hms

Can anyone please confirm this, or provide a work-around to be able to
retrieve&save stdout from a shell command?

Thanks,
P.Romero



More information about the gradsusr mailing list