Subject: bin/1081: /bin/sh ignores variable setting before "." built-in
To: None <gnats-admin@sun-lamp.cs.berkeley.edu>
From: Arne Henrik Juul <arnej@imf.unit.no>
List: netbsd-bugs
Date: 05/27/1995 10:35:06
>Number: 1081
>Category: bin
>Synopsis: /bin/sh ignores variable setting before "." built-in
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people (Utility Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat May 27 10:35:05 1995
>Originator: arnej@imf.unit.no
>Organization:
University of Trondheim, Norway
>Release: NetBSD-current, source date: May 23, 1995
>Environment:
All NetBSD systems should see this.
System: NetBSD rtfm.imf.unit.no 1.0A NetBSD 1.0A (RTFM) #2: Sat May 20 00:42:51 MET DST 1995 arnej@rtfm.imf.unit.no:/usr/src/sys/arch/i386/compile/RTFM i386
>Description:
During installation of trn 3.6 we found that it used the construct
"CONFIG=true . ../filexp.SH" in the configuration scripts. This should
be exactly equivalent to "CONFIG=true; . ../filexp.SH" (at least as
far as I can see when comparing with other /bin/sh's). According
to my late draft of Posix.2 this applies to other special built-ins
as well, but you would probably want to check against the final
standard for this. NetBSD's /bin/sh fails to set the variable at all.
>How-To-Repeat:
$ cd /tmp
$ cat > test-set-var.1
var1=value1
var2=value2 . /tmp/test-set-var.2
echo "after var1 is '$var1' and var2 is '$var2'"
^D
$ cat > test-set-var.2
echo "during sourcing, var1 is '$var1' and var2 is '$var2'"
^D
$ sh test-set-var.1
expected output:
during sourcing, var1 is 'value1' and var2 is 'value2'
after var1 is 'value1' and var2 is 'value2'
actual output:
during sourcing, var1 is 'value1' and var2 is ''
after var1 is 'value1' and var2 is ''
>Fix:
None, sorry.
>Audit-Trail:
>Unformatted: