Hi Simon,

> What I'm really trying to do is have an easy way to invoke arbitrary shell
> commands that may be piped, process the result in pico and maybe use that
> as the input for another command.
> I haven't found a generic example yet that doesn't specify the command
> specifically that allows arbitrary piping and still gives you access to
> intermediary results.

The most general way is to use the 'in' function in combination with an
invocation of the system shell ('bash' usually). This has more overhead
than direcly calling commands, but allows you to use all features of the

For example

   (in (list "sh" "-c" (pack "cmd1 -i" Var1 " -x " Var2 " | cmd2"))
      (while (line)
         ... ) )

Here the 'while' loop assumes that there are no empty lines. Instead you
may want to do

      (until (eof)
         ... )

It is hard to give a general rule, it depends a lot on what you want to
do. Perhaps you can post a concrete problem?

♪♫ Alex
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to