Email List: Xaustin-group-lX
[All Lists]

Re: Re: $@ and set -u

To: dgk@xxxxxxxxxxxxxxxx
Subject: Re: Re: $@ and set -u
From: Chet Ramey <chet.ramey@xxxxxxxx>
Date: Thu, 30 Apr 2009 11:06:16 -0400
Cc: austin-group-l@xxxxxxxxxxxxx, chet.ramey@xxxxxxxx
Read-receipt-to: chet.ramey@case.edu
References: <200904301329.n3UDTOXH005366@penguin.research.att.com>
> My response only considered what the standard says and why set -u was
> added to the shell.  It didn't consider actual practice.
> 
> Going back to ksh88, and as Chet says, ksh93, -u applies to all parameters
> not just variables.  I don't have a copy of the original Bourne shell so
> I don't know what it did in practice.

I have a copy of the original v7 shell (as filtered through Geoff Collyer),
and it behaves the same way.  I tested the OpenSolaris sh and the SVR4.2
sh, and they also do the same thing.  I concluded the the Bourne shell has
always behaved this way.

I also tested a fairly extensive list of open source shells, and dash
was the only one claiming Posix compliance that doesn't make it a fatal
error.  (zsh doesn't raise an error, but I wasn't running it in sh or ksh
mode.)

The ones I tested that behaved like bash4/ksh/Bourne shell were:

FreeBSD sh (which I take as representative of the BSD sh family)
posh
pdksh/mksh

There seems to be a great deal of existing practice out there.  The group
needs to decide whether or not we want to go in a different direction,
and I think we should add a note to the standard if we do.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    chet@case.edu    http://tiswww.tis.case.edu/~chet/

<Prev in Thread] Current Thread [Next in Thread>