An easy way to pipe input into shell commands?

Mark Schonewille m.schonewille at economy-x-talk.com
Sat Oct 2 07:34:36 CDT 2010


Hi David,

One possibility might be to use CURL to connect to your standalone through a socket and pipe the data from that connection to the next shell command. This will work on Unix machines but might bot work on Windows.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Download the Installer Maker plugin for Runtime Revolution at http://qurl.tk/ce Create installers for Mac and Windows on *every* Rev-compatible platform. No additional software needed.

On 2 okt 2010, at 14:31, David Bovill wrote:

> 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