Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #12133

Re: ${1+"$@"} does not generate multiple words if IFS is empty

From Andreas Schwab <schwab@linux-m68k.org>
Newsgroups gnu.bash.bug
Subject Re: ${1+"$@"} does not generate multiple words if IFS is empty
Date 2015-12-30 10:02 +0100
Message-ID <mailman.1334.1451466172.843.bug-bash@gnu.org> (permalink)
References <56835243.0Dp3As7Vk0rP8qDy%martijn@inlv.org>

Show all headers | View raw


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."

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: ${1+"$@"} does not generate multiple words if IFS is empty Andreas Schwab <schwab@linux-m68k.org> - 2015-12-30 10:02 +0100

csiph-web