bug-bash
[Top][All Lists]
Advanced

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

local unset IFS behaves as if local IFS is set but empty


From: Harald van Dijk
Subject: local unset IFS behaves as if local IFS is set but empty
Date: Sat, 20 Aug 2005 10:10:02 +0200
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050716)

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/tmp/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H  -I.  -I. -I./include -I./lib   -g -O2
uname output: Linux boostbox 2.6.13-rc6 #1 Tue Aug 9 21:45:47 CEST 2005 i686 
AMD Duron(tm) Processor AuthenticAMD GNU/Linux
Machine Type: i686-pc-linux-gnu

Bash Version: 3.0
Patch Level: 16
Release Status: release

Description:
        If I localise IFS in a function, and then unset it, it gets unset. However, if I 
then use an unquoted variable, it doesn't actually get split. This is what I expect from 
IFS="", not from unset IFS.

Repeat-By:
        var="a   b   c"
        f() {
                local IFS
                unset IFS
                echo ${IFS+set} # shows nothing, meaning IFS is really unset
                echo ${var} # shows "a   b   c" rather than "a b c" (without 
quotes)
        }
        f




reply via email to

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