[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bash string substitution bug (?)
From: |
Dmitry V Golovashkin |
Subject: |
Bash string substitution bug (?) |
Date: |
Thu, 10 Jan 2008 22:13:51 -0500 |
User-agent: |
Thunderbird 2.0.0.6 (X11/20071022) |
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: x86_64-redhat-linux-gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-redhat-linux-gnu'
-DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash'
-DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -O2 -g -pipe -m64
uname output: Linux acl201.unx.sas.com 2.6.9-42.ELsmp #1 SMP Wed Jul 12
23:32:02 EDT 2006 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-redhat-linux-gnu
Bash Version: 3.0
Patch Level: 15
Release Status: release
Description:
unexpected bad substitution:
enter the following simple list:
prompt: CLUSTER='1 2'; echo ${CLUSTER/${HOSTNAME%%.*}}
output: 1 2
the idea of the above line is to remove short HOSTNAME (without the
trailing domain)
from the CLUSTER - works fine (CLUSTER was assigned a dummy
value - irrelevant)
however the same operation with slash results in a bad substitution
error.
the substitution appears to be a valid one.
prompt: CLUSTER='1 2'; echo ${CLUSTER/${HOSTNAME/.*}}
output: -bash: ${HOSTNAME: bad substitution
Repeat-By:
Fix:
- Bash string substitution bug (?),
Dmitry V Golovashkin <=