On Monday 17 December 2012 09:39:18 Staffan Tylen wrote: > I think I need help understanding the use of the Monitor class. Reading the > documentation it seems like a monitor 'destination' is/should be a .Stream > object, is this correct? What I'm after is a way to catch the output from a > shell command into for example an .array or a .queue object where I can > manipulate it. I don't want it written to a file. Can this be done? > > Thanks in advance, > Staffan
Here is a way to do it (posted a year or so ago on this list): cmd2array: > #!/usr/bin/rexx > /* Example of ooRexx putting command output into arrays. */ > > parse arg command > queue1 = .SystemQueue~run(command) > say 'queue' queue1 'of type' queue1~class > queue2 = .SystemQueue~run('ls -l ~') > say 'queue' queue2 'of type' queue2~class > say '----------' > > do 5 > say 'pulling from queue1:' queue1~pull > say 'pulling from queue2:' queue2~pull > end > > say > say '---------- queue1:' > > do line over queue1 > say line > end > > say > say '---------- queue2:' > > do line over queue2 > say line > end > return > > ::require SystemQueue > > SystemQueue: > ::class SystemQueue subclass RexxQueue > > ::method "run" class > use strict arg command > queue = self~new(self~create) > command '| rxqueue "'queue~get'"' > return queue > > ::method uninit > self~delete > return > Leslie ------------------------------------------------------------------------------ LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d _______________________________________________ Oorexx-users mailing list Oorexx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-users