On Mon, 20 Jun 2016 17:59:23 -0700, James wrote:
> What's the difference between "$@" and ${1+"$@"}?
Nothing these days. Some older implementations of the shell had a bug in
that "$@" would evaluate to "" if there were no parameters, rather than
to nothing (i.e. the difference between a pointer to a NUL character and
a NULL pointer).
${1+"$@"} is a workaround for this bug. If the first parameter is not set
this evaluates to nothing. If the first parameter is set (even if set to
nothing) then the expression is the same as "$@".