On Wed, Nov 26, 2008 at 01:25:17PM -0500, Chet Ramey wrote:
> [EMAIL PROTECTED] wrote:
> > Gentlemen, I have discovered a documentation oversight. In the manual,
> > we see:
> > set -u --
> > : $@ $*
> > : $1
> > 
> > and
> > 
> > set --
> > : ${*?} [EMAIL PROTECTED]
> > : ${1?}
> > 
> > Therefore the -u paragraph needs to add that "$@ and $* unset are not
> > caught by -u, but $1, $2... are".
> 
> You've discovered a bug.  They should be treated the same way.
[...]

Though one may argue that $@ and $* are _set_ to the list of
arguments which in this case is empty, so it could be considered
as always being set. POSIX doesn't mention that they may ever be
unset.

zsh and ash behave like bash. Solaris 7 sh, ksh93 and pdksh
don't.

However zsh and ash differ from bash in:

$ ash -c 'echo "<${*+a}>"'
<a>
$ zsh -c 'echo "<${*+a}>"'
<a>
$ bash -c 'echo "<${*+a}>"'
<>

So it's true there's an inconsistency in bash.

I would also be tempted to say that after

a=()

[EMAIL PROTECTED] and a[*] should be considered set. That's the case in zsh
but not in ksh93 or bash, but then zsh arrays are quite
different from ksh/bash arrays.

-- 
Stéphane


Reply via email to