bug-bash
[Top][All Lists]
Advanced

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

Re: Unexpected IFS behaviour on 2.05 and 2.04


From: Chet Ramey
Subject: Re: Unexpected IFS behaviour on 2.05 and 2.04
Date: Thu, 12 Jul 2001 15:07:47 -0400

> Consider the following:
> 
> bash-2.05$ A=1/2
> bash-2.05$ IFS=/
> bash-2.05$ for f in $A/3 ; do echo $f ; done
> 1
> 2 3
> bash-2.05$
> 
> bash-2.04$ A=1/2
> bash-2.04$ IFS=/
> bash-2.04$ for f in $A/3 ; do echo $f ; done
> 1
> 2 3
> bash-2.04$
> 
> Now running the same on 2.02, I see:
> 
> bash-2.02$ A=1/2
> bash-2.02$ IFS=/
> bash-2.02$ for f in $A/3 ; do echo $f ; done
> 1
> 2
> 3
> bash-2.02$

Bug in bash-2.02.  POSIX.2 says that word splitting is performed only
on the results of expansion.  That means that the expansion of $A
gets split, but nothing else.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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