[BusyBox 0001047]: ash uses the variables in a way not visible to printenv
bugs at busybox.net
bugs at busybox.net
Wed Nov 12 23:44:23 UTC 2008
The following issue has been CLOSED
======================================================================
http://busybox.net/bugs/view.php?id=1047
======================================================================
Reported By: walter
Assigned To: BusyBox
======================================================================
Project: BusyBox
Issue ID: 1047
Category: Standards Compliance
Reproducibility: always
Severity: minor
Priority: normal
Status: closed
Resolution: open
Fixed in Version:
======================================================================
Date Submitted: 09-24-2006 05:54 PDT
Last Modified: 11-12-2008 15:44 PST
======================================================================
Summary: ash uses the variables in a way not visible to
printenv
Description:
clearly ash uses the variables in a way not visible to printenv
and different to sh. the example shows that only if variables are
exported
showup with printenv.
#/* test program */
f()
{
printenv FOO
}
echo "set + function"
FOO=test f
echo "printenv"
printenv FOO
echo "exported + printenv"
export FOO=exported
printenv FOO
======================================================================
----------------------------------------------------------------------
vda - 02-14-08 08:36
----------------------------------------------------------------------
printenv has nothing to do with it.
Smaller testcase:
f() { true; }
echo "case 1"
FOO=test /bin/true
env | grep FOO
echo "case 2"
FOO=test f
env | grep FOO
Surprisingly, with bash 3.2 in case 2 ("VAR=val shell_function") FOO
actually remains set in environment after shell function finishes, as if
it was an exported variable! This is strange and may be a bash bug.
$ sh testcase2
case 1
case 2
FOO=test
$ ./busybox ash testcase2
case 1
case 2
----------------------------------------------------------------------
vda - 11-12-08 15:44
----------------------------------------------------------------------
Looks like busybox's behavior is ok and bash's is buggy.
Issue History
Date Modified Username Field Change
======================================================================
09-24-06 05:54 walter New Issue
09-24-06 05:54 walter Status new => assigned
09-24-06 05:54 walter Assigned To => BusyBox
02-14-08 08:35 vda Note Added: 0004714
02-14-08 08:35 vda Note Edited: 0004714
02-14-08 08:36 vda Note Edited: 0004714
11-12-08 15:44 vda Status assigned => closed
11-12-08 15:44 vda Note Added: 0015704
======================================================================
More information about the busybox-cvs
mailing list