bug-bash
[Top][All Lists]
Advanced

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

Re: IFS handling and read


From: Greg Wooledge
Subject: Re: IFS handling and read
Date: Mon, 30 Nov 2009 08:13:29 -0500
User-agent: Mutt/1.4.2.3i

On Mon, Nov 30, 2009 at 11:46:03AM +0100, Lhunath (Maarten B.) wrote:
> Don't use pipelines to send streams to read.  Use file redirection instead:
> 
> Instead of ''command | read var''
> Use ''read var < <(command)''
> 
> I hardly see a need to change the existing implementation.

Or for the original problem case, use a here string:

IFS=: read a b <<< "1:2"

Between process substitutions (the <(command) thing) and here strings,
you should be able to do all your reads without subshells.




reply via email to

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