[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bash does filename expansion when assigning to array member in compo
From: |
Dan Douglas |
Subject: |
Re: bash does filename expansion when assigning to array member in compound form |
Date: |
Mon, 20 Aug 2012 16:12:19 -0500 |
User-agent: |
KMail/4.8.3 (Linux/3.4.6-pf+; KDE/4.8.3; x86_64; ; ) |
On Monday, August 20, 2012 07:44:51 PM Roman Rakus wrote:
> And how would you achieve to fill array with all file names containing
> `[1]=' for example.
$ ls
[1]=a [1]=b
$ ( typeset -a a=( \[1\]=* ); typeset -p a )
typeset -a a=('[1]=a' '[1]=b')
$ ( typeset -a a=( [1]=* ); typeset -p a )
typeset -a a=([1]='*')
$
In ksh93, by escaping. I think this is what most people would expect and
probably what Bash intended.
Of course, In that shell in order to use "[n]="-style indexing each and every
element needs to be specified that way explicitly. I like that Bash can just
implicitly start counting at any index.
--
Dan Douglas
- bash does filename expansion when assigning to array member in compound form, Gundi Cress, 2012/08/18
- 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 <=
- 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
- Re: bash does filename expansion when assigning to array member in compound form, Chet Ramey, 2012/08/29
- Re: bash does filename expansion when assigning to array member in compound form, Stephane Chazelas, 2012/08/21
- Re: bash does filename expansion when assigning to array member in compound form, Dan Douglas, 2012/08/21