Thanks a lot!
:-)
Chet Ramey wrote:
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
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
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