An easy way to pipe input into shell commands?

David Bovill david at vaudevillecourt.tv
Sat Oct 2 08:31:25 EDT 2010


Is there a neat way to pipe input into shell commands from STDIN? The usual
way I do it is to recreate everything as temporary files and then pass the
file references - however it is both a hassle and can leave clutter around
although I assume files stored in "the tempname" directory get cleared out
properly on all platforms (anyone - I've not tested this cross-platform?).

For smaller inputs (one liners) - you can construct a shell command which
pipes an echo command - like this:

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

But is you have a lot of text in a variable, that you want to pipe to a
shell command this is not going to work - hence the need to write out to a
temporary file. I'm just wandering if there is a way to do something like
set the contents of STDIN from LiveCode, then just enter the shell command,
or if this could be some form of feature request?



More information about the Use-livecode mailing list