On Mon, 7 Jun 2004, Leopold Toetsch wrote:

> Leopold Toetsch <[EMAIL PROTECTED]> wrote:
> > * there is no opcode to use it, e.g.:
>
> >    Pio = backtick Scmd, Pargv, Iflags
>
> I've now integrated that into the C<open> opcode:
>
>   .local pmc pipe
>   pipe = open "/bin/cat -n", "|-"
>
>   # or
>
>   pipe = open "/bin/ls -l", "-|"
>
> There is still no good way to pass arguments to commands - currently the
> given command gets split at spaces, which is of course broken with
> respect to quoted args.

Then lets add:

   backtick Pfilehandle, Scommand, Imode
   backtick Pfilehandle, Scommand, Imode, Pargarray

to the ops list. The first form just creates a new shell and passes in the
command as one big lump (quoting issues and all), while the second takes
an array of parameters and execs the command with those passed-in
parameters. Mode can be a bitmask:

bit 0: handle ties command's stdin
bit 1: Handle ties command's stdout
bit 2: handle ties command's stderr
bit 3: Fork the process

And yes, I know that Unices can't all tie multiple filehandles to child
processes well. That's fine, no reason to penalize the OSes that can...


                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to