home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.os2.programmer
- Path: sparky!uunet!stanford.edu!leland.Stanford.EDU!jasonc
- From: jasonc@leland.Stanford.EDU (Jason Campbell)
- Subject: Re: REXX WAITFOR cmd?
- Message-ID: <1992Jul22.054242.7886@leland.Stanford.EDU>
- Sender: news@leland.Stanford.EDU (Mr News)
- Organization: DSG, Stanford University, CA 94305, USA
- References: <9207182258.AA10355@cs.utexas.edu> <92202.121337SPS2@psuvm.psu.edu>
- Date: Wed, 22 Jul 92 05:42:42 GMT
- Lines: 38
-
- In article <92202.121337SPS2@psuvm.psu.edu> Steven P. Sedlmeyer <SPS2@psuvm.psu.edu> writes:
- >In article <9207182258.AA10355@cs.utexas.edu>, HARPER@VTVM1.CC.VT.EDU (Scott
- >Harper) says:
- >>
- >> What REXX command do I use to scan the system's output for a text string?
- >> I would like REXX to invoke a program then wait for a specific string to
- >> occur (a prompt) before continuing. This is basically the same as the
- >> WAITON function found in many communications package scripting languages...
-
- >You might try something like the following
- >/* start a process and look for a string in stdout */
-
- ....
-
- >address cmd 'start command | RXQUEUE' /* pipe stdout into rexx queue */
- >found = false /* string not found */
- >Do until found /* loop until we find string in stdout */
- > pull line /* pull line from queue */
-
- This will probably seek input from the console when nothing is pending on
- the queue (at least I think the documentation says it will). I'm not sure
- what will happen when REXX is waiting on the console and data appears on
- the queue.
-
- At any rate, another solution, which will ignore keyboard input:
-
- '@start <some-command-here> | RXQUEUE'
- do forever
- s = linein("queue:")
- if pos(target_string, s) > 0 then leave
- end
-
-
- Jason.
- --
- Jason Campbell | not talking for SU | "OS/2...saving the world thru software!"
- 1-> jasonc@leland.Stanford.EDU |2-> Prodigy: KSJB81e |3-> (415)497-3937
- -- Antidisestablishmentarians unite!
-