[Top][All Lists]

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

unset command violates IEEE Std 1003.1-2001 on some systems

From: ma
Subject: unset command violates IEEE Std 1003.1-2001 on some systems
Date: Tue, 26 Nov 2002 01:11:27 +0100 (CET)

Configuration Information [Automatically generated, do not change]:
Machine: i586
OS: linux
Compiler: gcc -I/usr/src/packages/BUILD/bash-2.05b
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i586' 
-DCONF_OSTYPE='linux' -DCONF_MACHTYPE='i586-suse-linux' -DCONF_VENDOR='suse' 
-DSHELL -DHAVE_CONFIG_H  -I.  -I. -I./include -I./lib  -O2 -march=i586 
-mcpu=i686 -fmessage-length=0 -D_GNU_SOURCE -Wall -pipe -g
uname output: Linux merlin 2.4.19-4GB #1 Fri Sep 13 13:19:15 UTC 2002 i686 
Machine Type: i586-suse-linux

Bash Version: 2.05b
Patch Level: 0
Release Status: release

bash unset will not consistently continue when applying
"unset" to an undefined variable or function.

IEEE Std 1003.1-2001 requests that unsetting an unset variable or
function does NOT cause an error condition. See

However, my Solaris bash 2.05.0(1)-release (from sunfreeware.com)
behaves differently and exits or sets $? to 1 after set +e. The same is
true for FreeBSD 4.7 and its bash 2.05b.004 from the ports.

        [Detailed description of the problem, suggestion, or complaint.]

bash -c 'BONK= ; unset BONK ; unset BONK ; echo $?'

if it reports 1, it's broken
if it reports 0 (it does for me on FreeBSD, bash-2.05b.004 there), it's ok

bash -c 'set -e ; f() { echo hi ; } ; unset -f f ; unset -f f ; echo good'

if it prints nothing -> broken
if it prints good -> fine
        [Describe the sequence of events that causes the problem
        to occur.]

        [Description of how to fix the problem.  If you don't know a
        fix for the problem, don't include this section.]

reply via email to

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