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


Groups > gnu.bash.bug > #14428 > unrolled thread

Re: Unquoted array slice ${a[@]:0} expands to just one word if IFS doesn't have a space

Started byGreg Wooledge <wooledg@eeg.ccf.org>
First post2018-08-01 08:12 -0400
Last post2018-08-01 08:12 -0400
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Unquoted array slice ${a[@]:0} expands to just one word if IFS doesn't have a space Greg Wooledge <wooledg@eeg.ccf.org> - 2018-08-01 08:12 -0400

#14428 — Re: Unquoted array slice ${a[@]:0} expands to just one word if IFS doesn't have a space

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2018-08-01 08:12 -0400
SubjectRe: Unquoted array slice ${a[@]:0} expands to just one word if IFS doesn't have a space
Message-ID<mailman.4539.1533125608.1292.bug-bash@gnu.org>
On Wed, Aug 01, 2018 at 02:43:27PM +0300, Ilkka Virta wrote:
> On both Bash 4.4.12(1)-release and 5.0.0(1)-alpha, a subarray slice like
> ${a[@]:0} expands to just one word if unquoted (and if IFS doesn't
> contain a space):

This just reinforces the point that unquoted $@ or $* (or the array
equivalent) is a bug in the script.  It gives unpredictable results.
Don't do it.

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web