On Oct 2, 2010, at 6:31 AM, David Bovill wrote:

Is there a neat way to pipe input into shell commands from STDIN?

You might consider the slave process feature of LiveCode which has been revamped in 4.5. Use 'open process' to run the command-line tool. Use 'write ... to process' to write to its STDIN. Get the result with 'read from process'. There is an example in the revision notes. This is not new. Working well is presumably new.

The limitation is that when you close the pipe to the process, LiveCode (that is, the version of Revolution I tested years ago-- things may have changed) also closes the pipe from the process, so this would not be good for things that do their work after the close, such as sort.

put "echo 'Hello world!' | commandLineThatTakesSTDIN" into someShell
put shell (someShell)

Cool!

Dar Scott


--
**************************************
Dar Scott
Dar Scott Consulting  and  darzLAB
8637 Horacio Place NE
Albuquerque, NM 87111

Lab, office, home:  +1 505 299 9497
Fax:                try 299-9497
Skype:              lets set up a time

http://www.swcp.com/dsc
[email protected]

Computer programming and tinkering
**************************************



_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to