[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: IFS handling and read
From: |
Lhunath (Maarten B.) |
Subject: |
Re: IFS handling and read |
Date: |
Mon, 30 Nov 2009 11:46:03 +0100 |
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
>>
>> POSIX permits, but does not require, that the final element of a pipeline
>> be executed in a subshell. Bash uses the subshell, ksh does not.
>> Variable assignments in a subshell do not affect the parent.
>
> I am regularly bitten by this. This is a major pain; it makes "read" very
> inconvenient to use (whatever IFS is).
>
> Could this be changed in the future?
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.
- IFS handling and read, Юрий Пухальский, 2009/11/27
- IFS handling and read, Юрий Пухальский, 2009/11/26
- Re: IFS handling and read, Eric Blake, 2009/11/26
- Re: IFS handling and read, Marc Herbert, 2009/11/30
- Re: IFS handling and read,
Lhunath (Maarten B.) <=
- Re: IFS handling and read, Greg Wooledge, 2009/11/30
- Re: IFS handling and read, Chris F.A. Johnson, 2009/11/30
- Re: IFS handling and read, Lhunath (Maarten B.), 2009/11/30
- Re: IFS handling and read, Chris F.A. Johnson, 2009/11/30
- Re: IFS handling and read, Chet Ramey, 2009/11/30
- Re: IFS handling and read, Lhunath (Maarten B.), 2009/11/30
- Message not available
- Re: IFS handling and read, Jan Schampera, 2009/11/30
- Re: IFS handling and read, Andreas Schwab, 2009/11/30
- Re: IFS handling and read, Marc Herbert, 2009/11/30
- Re: IFS handling and read, Lhunath (Maarten B.), 2009/11/30