bugmail-sender at Sun.COM wrote: > > *Synopsis*: *ksh93* unset of a variable which is not set should return 0 > > > *Change Request ID*: 6791838 > > *Synopsis*: *ksh93* unset of a variable which is not set should return 0 > > Product: solaris > Category: shell > Subcategory: korn93 > Type: Defect > Subtype: Functionality > Status: 5-Cause Known > Substatus: > Priority: 3-Medium > Introduced In Release: > Introduced In Build: > Responsible Engineer: <User 1-5Q-5151> > Keywords: > > === *Description* ============================================================ > In ksh93, the special builtin "unset" will exit 1 when its argument is a > variable which is not set, but it should exit 0, according to the POSIX > standards.
Erm... I interpret the standard a bit different in this case: http://www.opengroup.org/onlinepubs/000095399/utilities/unset.html says: -- snip -- EXIT STATUS 0 All name operands were successfully unset. >0 At least one name could not be unset. -- snip -- Both ksh88, ksh93 and /usr/xpg4/bin/sh in Solaris behave like this: -- snip -- $ /usr/xpg4/bin/sh -c 'unset kjashdjkashd || print "unset returned non-zero exit code"' unset returned non-zero exit code $ ksh -c 'unset kjashdjkashd || print "unset returned non-zero exit code"' unset returned non-zero exit code $ ksh93 -c 'unset kjashdjkashd || print "unset returned non-zero exit code"' unset returned non-zero exit code -- snip -- Don: Is there any clarification request which defined the behaviour of "unset" more precisely ? ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz at nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 3992797 (;O/ \/ \O;)