[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Use of pipe in $(< filename | program) returns null
From: |
DennisW |
Subject: |
Re: Use of pipe in $(< filename | program) returns null |
Date: |
Sat, 28 Nov 2009 07:16:58 -0800 (PST) |
User-agent: |
G2/1.0 |
On Nov 28, 4:46 am, Andreas Schwab <sch...@linux-m68k.org> wrote:
> Bernd Eggink <mono...@sudrala.de> writes:
> > Am 28.11.2009 06:35, schrieb r...@saturn.syslang.net:
>
> >> Description:
> >> use of $(< filename | program) does not work. It either should or
> >> it should be properly documented.
> >> The problem also happens on bash4.
>
> >> Repeat-By:
>
> >> qq=$(< /etc/passwd | grep sys)
> >> echo $qq
> >> # result is null
>
> >> Fix:
> >> Either fix the docs to tell people that a pipe is not allowed or
> >> fix the code to allow it.
>
> > The problem is not the pipe but the fact that '<filename' is an empty
> > command which does nothing. If you want 'program' to read from 'file', use
> > program<file'.
>
> Or even $(< /etc/passwd grep sys).
>
> Andreas.
>
> --
> Andreas Schwab, sch...@linux-m68k.org
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
> "And now for something completely different."
Or even $(grep sys /etc/passwd)