bug-bash
[Top][All Lists]
Advanced

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

Re: Use of pipe in $(< filename | program) returns null


From: Andreas Schwab
Subject: Re: Use of pipe in $(< filename | program) returns null
Date: Sat, 28 Nov 2009 11:46:58 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Bernd Eggink <address@hidden> writes:

> Am 28.11.2009 06:35, schrieb address@hidden:
>>
>> 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, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

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