>Number: 6591
>Category: system
>Synopsis: /bin/sh doesn't reset variable back in some cases
>Confidential: yes
>Severity: serious
>Priority: medium
>Responsible: bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: unknown
>Arrival-Date: Wed Apr 20 17:30:01 GMT 2011
>Closed-Date:
>Last-Modified:
>Originator:
>Release:
>Organization:
>Environment:
System : OpenBSD 4.9
Details : OpenBSD 4.9-current (GENERIC.MP) #53: Sat Apr 16 16:15:30
MDT 2011
[email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
Architecture: OpenBSD.amd64
Machine : amd64
>Description:
When using some of the built-in commands with sh or ksh the
variable won't reset back. I've found that it happens with
':' and internal functions at least.
>How-To-Repeat:
iku@kameli:/tmp% cat /tmp/test3
random_function()
{
}
a=foo
a=temp ls >/dev/null
echo "$a"
# : is a built-in
a=temp :
echo "$a"
a=tempvalue random_function
echo "$a"
iku@kameli:/tmp% sh /tmp/test3
foo
temp
tempvalue
iku@kameli:/tmp% ksh /tmp/test3
foo
temp
tempvalue
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: