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' -DLOCALEDI
Dmitry V Golovashkin schrieb:
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)
fro
Bernd Eggink wrote:
prompt: CLUSTER='1 2'; echo ${CLUSTER/${HOSTNAME/.*}}
output: -bash: ${HOSTNAME: bad substitution
Apparently bash interprets this as ${parameter/pattern/string}
where pattern = ${HOSTNAME. Looks like a bug; it works in ksh.
That is, in fact, what
Chet Ramey schrieb:
Bernd Eggink wrote:
prompt: CLUSTER='1 2'; echo ${CLUSTER/${HOSTNAME/.*}}
output: -bash: ${HOSTNAME: bad substitution
Apparently bash interprets this as ${parameter/pattern/string}
where pattern = ${HOSTNAME. Looks like a bug; it works in ksh.
Th
Bernd Eggink wrote:
Chet Ramey schrieb:
Bernd Eggink wrote:
prompt: CLUSTER='1 2'; echo ${CLUSTER/${HOSTNAME/.*}}
output: -bash: ${HOSTNAME: bad substitution
Apparently bash interprets this as ${parameter/pattern/string}
where pattern = ${HOSTNAME. Looks like a bug;
Dave Rutherford wrote:
I know test's quirks. Does [[ have quirks? Are they the same?
Is there room in my grey matter to hold both sets of quirks
and keep them straight?
[[ was designed to remedy test's quirks, so it shouldn't really have
any of its own. In addition to the functionality prov
either
VALUE=host1.blah.com
echo ${VALUE//.*}
or
echo ${VALUE/.*}
is accepted by Bash and works exactly as I would expect it - meaning
it correctly produces "host1" - removes the dot (dot is just a character
- we are not
in the regular expression world) - so the dot and the tr