bug-bash
[Top][All Lists]
Advanced

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

bug in unset in POSIX mode


From: Eric Blake
Subject: bug in unset in POSIX mode
Date: Thu, 19 May 2005 21:04:39 -0600
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Configuration Information:
Machine: i686
OS: cygwin
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash.exe' -DCONF_HOSTTYPE='i686'
- -DCONF_OSTYPE='cygwin' -DCONF_MACHTYPE='i686-pc-cygwin' -DCONF_VENDOR='pc'
- -DLOCALEDIR='/usr/local/share/locale' -DPACKAGE='bash' -DSHELL
- -DHAVE_CONFIG_H -DRECYCLES_PIDS  -I.  -I. -I./include -I./lib   -g -O2
uname output: CYGWIN_NT-5.1 LOUNGE 1.5.16(0.128/4/2) 2005-04-25 20:26 i686
unknown unknown Cygwin
Machine Type: i686-pc-cygwin

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

Description:
  POSIX XCU 2.9.1 requires that for all simple commands (special built-ins
or otherwise), variables be set in the current environment BEFORE
executing the command.  Therefore, both of the two special built-ins that
can unset variables (unset and .) should end up with foo not set in the
environment after completion, but with bar remaining set.  The trace shows
that unset is buggy.

See my report to the austin group,
https://www.opengroup.org/sophocles/show_mail.tpl?source=L&listname=austin-group-l&id=8356



Repeat-By:

$ set -o posix
$ echo unset foo > dot
$ unset foo bar
$ foo=bar bar=blah unset foo      # BUG - foo should be unset
$ echo ${foo-unset} ${bar-unset}
bar blah
$ unset foo bar
$ foo=bar bar=blah . ./dot        # Correct - only bar remains set
$ echo ${foo-unset} ${bar-unset}
unset blah
$

- --
Life is short - so eat dessert first!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCjVPH84KuGfSFAYARAt55AJ0Q0hxBYrP0Vv10pcYXP7i/fIwXuACdFax4
KJiecs2dl+rKx65zEyCQ/4E=
=52Qk
-----END PGP SIGNATURE-----




reply via email to

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