On 1/30/13 12:16 AM, Dan Douglas wrote:

>>>  3. Another IFS oddity via "command"
>>>
>>> IFS can be given "two values at once" through the environment of a 
>>> redirection.
>>
>> I have to look at this one.  It's clear that the temporary environment
>> given to `command' is like the temp environment supplied to `eval', and
>> needs to persist through all of the commands executed by `command'.  I
>> have to figure out whether that temporary environment counts as the temp
>> environment to `cat' (I don't think so) and how to reconcile the variable
>> lookups during redirection expansion.
> 
> I think at least the variable should be accessible to builtins or functions 
> run by `command' (if not cat). Maybe you meant it doesn't actually get 
> exported to non-builtins? In this case, the redirect should be applying to 
> the 
> `command' command, so the outer environment is what applies to the redirect 
> just like any other normal command (I think).

It's all good.  The problem was that bash was using stale cached
information about IFS -- it was updated when the variable was assigned in
the temp environment, but not invalidated when doing redirections, since
redirections don't have access to the temp environment.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to