bmacintyre@watcgl.waterloo.edu (Blair MacIntyre) (05/02/89)
Ok, heres a simple(?) ARexx question: How can I get the output of a DOS program, say date or "ls -l fred", etc. into a variable inside of an ARexx program? I couldn't find anything skimming through the manual, so the closest I could get was something like: date ">pipe:date" call open mydate,"pipe:date",read datestr = read(mydate) call close mydate which seems very round about, to me anyway. What I am trying to do is modify Archie.rexx to behave like the temporary backup deamon on Unix - I want it to create a directory for each file ( no problem ) and store modifications in it with the filenames being the timestamp it was changed at. Speaking of which, does anyone have ( or know where I can get ) some more Rexx scripts? Mostly for learning/modifying ... not BIX please, I have no access to that! Thanx, Blair, slowing dwindling to being just another Amiga "user" ( I wish I had a project on my Amiga ... sigh ) -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-///-= = Blair MacIntyre, bmacintyre@watcgl.{waterloo.edu, UWaterloo.ca} \\\/// = = now appearing at the Computer Graphics Lab, U of Waterloo! \XX/ = = "Don't be mean ... remember, no matter where you go, there you are." BBanzai=
mwm@eris.berkeley.edu (Mike (I'll think of something yet) Meyer) (05/03/89)
In article <9479@watcgl.waterloo.edu> bmacintyre@watcgl.waterloo.edu (Blair MacIntyre) writes:
<
<Ok, heres a simple(?) ARexx question:
<
< How can I get the output of a DOS program, say date or
<"ls -l fred", etc. into a variable inside of an ARexx program?
<I couldn't find anything skimming through the manual, so the
<closest I could get was something like:
<
< date ">pipe:date"
< call open mydate,"pipe:date",read
< datestr = read(mydate)
< call close mydate
There's a tool that comes with wshell - "execio". Use it, like so:
'date | execio var datestr'
done.
Furthermore, you can get multiple lines, for instance:
'execio read' file 'stem data.'
data.0 will have the number of lines, and data.[1-#] will have the
lines. This is about an order of magnitude faster than reading the
stuff in yourself.
execio also does "grep-like" things for you. For instance, to get the
free space on the disk whose name is in volume, I do:
'info | execio locate' volume 'for 1 var infoline'
freespace = word(infoline, 4)
Of course, "info volume" could also be used and you could drop the
"for 1".
<mike
--
I'm gonna lasso you with my rubberband lazer, Mike Meyer
Pull you closer to me, and look right to the moon. mwm@berkeley.edu
Ride side by side when worlds collide, ucbvax!mwm
And slip into the Martian tide. mwm@ucbjade.BITNET
will@waf2000.UUCP (Will Fiveash) (07/15/90)
I have been trying to integrate RCS commands with ARexx and CED. Unfortunately, I seem unable to execute the RCS command ci without crashing my system. What I have tried to do is launch an ARexx command that would open a newcli and reassign STDOUT and STDIN to that cli. When ci is run I want ci to get its input from the new cli. Is it possible to do this? Any good examples of how to use pragma('*')? -- Will Fiveash UUCP:home ...!cs.utexas.edu!ut-emx!waf2000!will UUCP:work ...!cs.utexas.edu!ibmchs!auschs!fiveash.austin.ibm.com!will