[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: read builtin. input processes improperly inheriting IFS setting
From: |
Greg Wooledge |
Subject: |
Re: read builtin. input processes improperly inheriting IFS setting |
Date: |
Fri, 26 Jul 2013 16:47:44 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Fri, Jul 26, 2013 at 10:38:46PM +0200, Andreas Schwab wrote:
> Greg Wooledge <wooledg@eeg.ccf.org> writes:
>
> > Your unquoted $instring is being split into fields by bash, which is
> > operating with IFS=: at that point.
>
> Variable assignments are supposed to be performed _after_ redirections
> (read is not a special built-in).
Do you mean variable expansions? I'm willing to concede that there may
be a bug here, but your explanation is confusing to me.
Here's the code in question, simplified even further:
imadev:~$ unset IFS
imadev:~$ foo=a/b/c
imadev:~$ cat < <(echo $foo)
a/b/c
imadev:~$ IFS=/ cat < <(echo $foo)
a b c
Clearly the IFS assignment is affecting the expansion of $foo inside
the process substitution. This has nothing to do with read.
By the way, I get the same result in both 4.3.0-alpha and 1.14.7 (except
that I can't unset IFS in 1.14.7).