[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
array=(...) and filename generation
From: |
Stephane Chazelas |
Subject: |
array=(...) and filename generation |
Date: |
Thu, 30 Oct 2003 14:30:10 +0100 |
Configuration Information [Automatically generated, do not change]:
Machine: i586
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i586'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i586-pc-linux-gnu'
-DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -g -O2
uname output: Linux pcchazelas 2.4.21-rc2 #2 jeu mai 22 18:28:21 CEST 2003 i586
unknown unknown GNU/Linux
Machine Type: i586-pc-linux-gnu
Bash Version: 2.05b
Patch Level: 0
Release Status: release
Description:
In
array=(*)
if one of the files in the current directory is like
'[<n>]=whatever', bash interprets it as being assignment to a
given array index.
Same thing in:
var='[12]=whatever' IFS=; set -f
array=(A B C $var)
array=(A B "$var")
Repeat-By:
mkdir /tmp/Z
cd /tmp/Z
touch '[0' '[00' '[000' '[1]=whatever'
echo *
l=(*)
echo "${l[@]}"
var='[3]=whatever'
l=($var)
echo ${l[3]}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- array=(...) and filename generation,
Stephane Chazelas <=