Re: ${1+"$@"} does not generate multiple words if IFS is empty
From:
Andreas Schwab
Subject:
Re: ${1+"$@"} does not generate multiple words if IFS is empty
Date:
Wed, 30 Dec 2015 10:02:41 +0100
User-agent:
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
martijn@inlv.org writes:
> The substitution ${1+"$@"} should resolve to "$@" if there is at
> least one parameter -- i.e. one word per parameter. This works fine
> if IFS contains any character or is unset. If IFS is empty, it
> instead resolves to the equivalent of "$*", i.e. a single word
> concatenating all the parameters without a separator. IFS should
> not influence the behaviour of "$@" under any circumstances.http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_05
"If the value of IFS is null, no field splitting shall be performed."
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."