3 ms·
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Shell-Substitutions.html https://www.gnu.org/savannah-checkouts/gnu/autoconf/
by jwilk 9y ago
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Shell-Substitutions.html https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/a...
One of the most famous shell-portability issues is related to "$@". When there are no positional arguments, Posix says that "$@" is supposed to be equivalent to nothing, but the original Unix version 7 Bourne shell treated it as equivalent to "" instead, and this behavior survives in later implementations like Digital Unix 5.0.
The traditional way to work around this portability problem is to use ${1+"$@"}.
- LukeShu 9y agoThanks for digging that up! But for scripts written for FreeBSD in 2002 [1], I have to wonder which non-POSIX-y shells they were worried about. [1]: https://github.com/freebsd/freebsd/commit/55d0b8395514ae4055e7af8e4e9812637dbcc463 https://github.com/freebsd/freebsd/commit/55d0b8395514ae4055...