[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem with expansion of empty elements in ${arrays[*]:0}
From: |
Vítor De Araújo |
Subject: |
Problem with expansion of empty elements in ${arrays[*]:0} |
Date: |
Sun, 29 Jun 2008 18:17:53 -0700 (PDT) |
Configuration Information [Automatically generated, do not change]:
Machine: i486
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL
-DHAVE_CONFIG_H -I. -I../bash -I../bash/include -I../bash/lib -g -O2
uname output: Linux exmachina 2.6.18-4-686 #1 SMP Mon Mar 26 17:17:36 UTC 2007
i686 GNU/Linux
Machine Type: i486-pc-linux-gnu
Bash Version: 3.1
Patch Level: 17
Release Status: release
Description:
An expansion like ${array[*]:index} renders empty elements as delete
(ASCII 127) characters. I have no idea of why this happens.
I am using bash 3.1, but I have tested bash 3.2.27 on an Ubuntu 7.04 machine
and it happens as well.
Repeat-By:
A simplified version of the code which caused the problem is:
IFS=/
file=/mnt/cdrom/RedHat/RPMS
echo "${file[*]:0:3}"
This will render "^?/mnt/cdrom/RedHat/RPMS".
It happens no matter the value of $IFS. For example:
i[0]=foo
i[1]=
i[2]=bar
i[3]=
echo "${i[*]:0}"
Will output "foo ^? bar ^?".
Strange...
--
Vítor De Araújo
Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua
cara @ymail.com ou @rocketmail.com.
http://br.new.mail.yahoo.com/addresses
- Problem with expansion of empty elements in ${arrays[*]:0},
Vítor De Araújo <=