[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Unquoted array slice ${a[@]:0} expands to just one word if IFS doesn
From: |
Greg Wooledge |
Subject: |
Re: Unquoted array slice ${a[@]:0} expands to just one word if IFS doesn't have a space |
Date: |
Wed, 1 Aug 2018 08:12:51 -0400 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
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.
Re: Unquoted array slice ${a[@]:0} expands to just one word if IFS doesn't have a space, Chet Ramey, 2018/08/02