[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multiple inputs / outputs through descriptors

From: Bob Proulx
Subject: Re: multiple inputs / outputs through descriptors
Date: Sun, 31 Aug 2003 17:33:56 -0600
User-agent: Mutt/1.3.28i

address@hidden wrote:
>   But how would I make the open FDs available to a 
> sub-shell? e.g. how would I say :
>  e.g. this gives me syntax error :
>   ( read 63>&1 ; read 62>&1 ) <(ls) <(ls -L)

If you use 'echo' to see what is happening things will be more clear.

  echo <(ls) <(ls -l)
  /dev/fd/63 /dev/fd/62

The <(command) portions are being replaced by filenames.  So your
command looks like this.  If you try this you will get the same syntax

  ( read 63>&1 ; read 62>&1 ) /dev/fd/63 /dev/fd/62

The magic of <(command) is that it is all replaced by filenames and
commands which are run under that only see filenames.  They don't know
that another set of processes and pipes were opened around them.  They
don't need to know that.

If you are just wanting to concatenate the output of several commands
as it seems then just use cat.

  cat <(ls) <(ls -l)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]