On 1/12/13 9:48 AM, John Kearney wrote:
> anyway now we have a point I disagree that
> "${@}"
>
> should expand to 0 or more words, from the documentation it should be 1
> or more. At least that is how I read that paragragh. IT says it will
> split the word not make the word vanish.
> so I had to test and it really does how weird, is that in the posix spec?.
Yes. Here's the relevant sentence from the man page description of $@:
When there are no positional parameters, "$@" and $@ expand to
nothing (i.e., they are removed).
Posix says something similar:
If there are no positional parameters, the expansion of '@' shall
generate zero fields, even when '@' is double-quoted.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/