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


Groups > gnu.bash.bug > #16148

Expansions for array assignment not documented

Path csiph.com!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From "E. Choroba" <choroba@matfyz.cz>
Newsgroups gnu.bash.bug
Subject Expansions for array assignment not documented
Date Fri, 17 Apr 2020 11:48:37 +0200 (CEST)
Lines 43
Approved bug-bash@gnu.org
Message-ID <mailman.495.1587128427.3066.bug-bash@gnu.org> (permalink)
References <alpine.LSU.2.21.2004171140040.4631@triangle>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; format=flowed; charset=US-ASCII
X-Trace usenet.stanford.edu 1587128427 32104 209.51.188.17 (17 Apr 2020 13:00:27 GMT)
X-Complaints-To action@cs.stanford.edu
To bug-bash@gnu.org
Envelope-to bug-bash@gnu.org
X-Virus-Scanned amavisd-new at ufal.mff.cuni.cz
X-X-Sender jan.stepanek@triangle
User-Agent Alpine 2.21 (LSU 202 2017-01-01)
X-detected-operating-system by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy]
X-Received-From 195.113.20.158
X-Mailman-Approved-At Fri, 17 Apr 2020 09:00:26 -0400
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <alpine.LSU.2.21.2004171140040.4631@triangle>
Xref csiph.com gnu.bash.bug:16148

Show key headers only | View raw


Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc -I/home/abuild/rpmbuild/BUILD/bash-4.4 -L/home/abuild/rpmbuild/BUILD/bash-4.4/../readline-7.0
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-suse-linux-gnu' -DCONF_VENDOR='suse' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g  -D_GNU_SOURCE -DRECYCLES_PIDS -Wall -g -Wuninitialized -Wextra -Wno-switch-enum -Wno-unused-variable -Wno-unused-parameter -Wno-parentheses -ftree-loop-linear -pipe -DBNC382214=0 -DIMPORT_FUNCTIONS_DEF=0 -fprofile-use -fprofile-correction
uname output: Linux triangle 4.12.14-lp151.28.44-default #1 SMP Fri Mar 20 18:20:20 UTC 2020 (dbf1aea) x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-suse-linux-gnu

Bash Version: 4.4
Patch Level: 23
Release Status: release

Description:
     Expansions in an assignment are documented under "SIMPLE COMMAND EXPANSION":

     > The text after the = in each variable assignment undergoes tilde
     > expansion, parameter expansion, command substitution, arithmetic
     > expansion, and quote removal before being assigned to the
     > variable.

     However, a compound assignment to an array is different: the
     values also undergo pathname and brace expansions:

         files=(*)
         numbers=({1..10})

     Originally discovered by Roland at
     https://stackoverflow.com/q/61267714/1030675.


Repeat-By:
     I've searched the whole "man bash" for "array" and haven't found
     this documented. It's possible I've missed the documentation.

Fix:
     The additional expansions should be documented either in the
     paragraph quoted above, or in the "ARRAYS" section where compound
     assignment is described.

Cheers,

Ch.

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


Thread

Expansions for array assignment not documented "E. Choroba" <choroba@matfyz.cz> - 2020-04-17 11:48 +0200

csiph-web