On Wed, 18 Feb 2004 3:26pm -0300, rollor wrote:
> so, while and read together can read
> from a fd, but when I use
> while read l;do ..;done <(command)
> it return a sintax error, why ?!
> it is a bug in the syntax check ?!
No, it's not a bug.
The shell returns syntax error 'cause it _is_ a misplaced token.
> and why using while ....; done <
> <(cmd) works ?
Just because it's the correct syntax. The parser needs that.
For instance, try doing the same with a ``real'' named pipe:
$ mkfifo my_pipe
mkfifo: created fifo `my_pipe'
$ while read foo; do echo $foo; done my_pipe
bash: syntax error near unexpected token `my_pipe'
The corrected syntax:
$ while read foo; do echo $foo; done < my_pipe
bar
--
Felipe Kellermann