LUA SHELL & others through shell
david at anon.nu
david at anon.nu
Tue Sep 21 06:51:05 EDT 2004
Hi Mr Bill :)
william griffin wrote:
> I can't help but think there is a better way to send commands to a
> program
> running in unix other than : shell(<the program name> & cr & <a field
> full of commands>)
> It seems to me that simply using shell() doesn't open the process
> permanently
> like sending the command to terminal.
Not that I've found yet.
> Maybe somewhere in the other language/ environment/ whatisit I should
> have some statements to read and write data back and forth
> to and from the rev application/standalone via sockets?
Probably the easiest I think would be to use EXPECT
(http://expect.nist.gov/) - this get around pretty well everything and
is purpose designed to do what you want - a truly beautifully ugly hack
:) It has C bindings, is fast and light and well tested. You don't have
to use the C bindings - as their is a language independent API as well.
It basically allows you to put wrappers around any interactive command
line tool so that you can treat it as a nicely behaves script you can
call and get your results back. And yes you have good control over the
process (backgrounding etc).
> Any thoughts?
Another related thought is to something like SWIG if what you want is
intercommunication between a wide range of languages (via C bindings),
or a project called SIMPL. I've done a little light weight research and
testing on most of these - but no decisions made yet. So any thoughts
from the list appreciated,
david
More information about the use-livecode
mailing list