bug-bash
[Top][All Lists]
Advanced

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

Re: IFS handling and read


From: Marc Herbert
Subject: Re: IFS handling and read
Date: Mon, 30 Nov 2009 13:10:10 +0000
User-agent: Thunderbird 2.0.0.21 (X11/20090320)

Lhunath (Maarten B.) a écrit :
> On 30 Nov 2009, at 11:34, Marc Herbert wrote:
> 
>> Eric Blake a écrit :
>>> This is E4 in the FAQ:
>>> ftp://ftp.cwru.edu/pub/bash/FAQ

> Instead of ''commands | read var''
> Use ''read var < <(commands)''
> I hardly see a need to change the existing implementation.

As mentioned in the FAQ, ''read var < <(commands)'' is not portable.

All alternatives in the FAQ (portable or not) are less readable than a
simple pipe. They are all more verbose and introduce an extra level of
nesting when you have only one "command". They all need to be read
"backwards" with respect to the execution flow. If you want to keep your
code readable, they practically all force you to define a function for
"commands" as soon as you have more than a few commands.

Every entry in an FAQ is by mere definition a problem that many people
wast... spend time on.

It is admittedly not a question of life or death but some other shells
apparently have it so why not bash? Just asking.





reply via email to

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