[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bash does filename expansion when assigning to array member in compound
From: |
Gundi Cress |
Subject: |
bash does filename expansion when assigning to array member in compound form |
Date: |
18 Aug 2012 10:48:53 GMT |
User-agent: |
Pan/0.136 (I'm far too busy being delicious; GIT 926a150 git://git.gnome.org/pan2) |
This is a question about bash's behaviour concerning assignment to array
members.
Bash Version 4.2.24(1)-release (x86_64-pc-linux-gnu)
The bash manual (version 4.1, chapter 3.4) says about assignment
to shell variables: "Filename expansion is not performed."
simple test to proof this on the command line:
$ varx=*.*; echo "$varx"
=> *.*
This is true also for assignment to array members.
$ vary[0]=*.*; echo "${vary[0]}"
=> *.*
But when compound form of asignment is used, filename expansion _IS_
performed.
$ varz=(*.*); echo "${varz[0]}"
=> file1.abc file2.xyz
If this is a feature, I can't find any documentation.
Is this a bug?
Thank you for your help
Gundi
- bash does filename expansion when assigning to array member in compound form,
Gundi Cress <=
- Re: bash does filename expansion when assigning to array member in compound form, Dan Douglas, 2012/08/18
- Message not available
- Re: bash does filename expansion when assigning to array member in compound form, Gundi Cress, 2012/08/20
- Re: bash does filename expansion when assigning to array member in compound form, Roman Rakus, 2012/08/20
- Re: bash does filename expansion when assigning to array member in compound form, Dan Douglas, 2012/08/20
- Re: bash does filename expansion when assigning to array member in compound form, Chet Ramey, 2012/08/22
- Re: bash does filename expansion when assigning to array member in compound form, Chet Ramey, 2012/08/24
- Re: bash does filename expansion when assigning to array member in compound form, Dan Douglas, 2012/08/29