On Wed, Jun 11, 2008 at 08:09:13PM -0500, Raphael Geissert wrote: > Stephane Chazelas wrote: > .. > > 3$ b=x f > > x > > 4$ echo $b > > x > > > > and (4) shouldn't have output "x" if > > I read POSIX correctly. > > This is a known issue of some shells. > http://code.dogmap.org/lintsh/ : > > "var=value command", if it the command is a shell function or one of > certain builtins, may leave the variable set after the command completes > (pdksh, Solaris sh), or may revert it to its previous state for subsequent > commands (bash). > > I don't remember what SuS v3 says about that. [...]
Solaris /bin/sh is the Bourne shell, so it's not meant to be POSIX. Its POSIX sh is in /usr/xpg4/bin or /usr/xpg6/bin, the /bin/sh is only there for backward compatibility and shouldn't be used for new scripts. AFAICT, POSIX/SUSv3 says that the variables should only remain after for the special builtins: break colon continue dot eval exec exit (well...) export readonly return set shift times trap unset, unless used with command. -- Stéphane -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]