bug-bash
[Top][All Lists]
Advanced

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

Strange behavior of IFS?


From: Clark J. Wang
Subject: Strange behavior of IFS?
Date: Thu, 15 Apr 2010 21:58:42 +0800

Look at following result:

# cat foo.sh
string=aa:bb:cc
oldIFS=$IFS
IFS=:
for i in "$string"; do
    echo $i
done
IFS=$oldIFS
# bash foo.sh
aa bb cc
#

I don't understand why the $string was still splitted into words since
it's double quoted. Anyone can give a reasonable explanation?

-Clark




reply via email to

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