VALUE=${VAR| |o}
I found this variable assignment in shell script. I can't understand why || sign is used here.
EDIT
Code given in a comment:
#!/bin/bash
source /opt/cpf/bin/cpf_logging_helper.sh
STATE=$1
DNS_MASTER=${TEST.DNS.DNS_MASTER:-o}
service status dns > /dev/null
rval=$?
if [ $rval -eq 0 ]
then
if [ $DNS_MASTER == `hostname -s` ]
then
echo "1"
else
echo "2"
fi
fi
bash
. – DopeGhoti Jun 3 '16 at 6:37bash
and got a syntax error, and there is no mention of this syntax in the manual page. Inline replacement syntax is${var/foo/bar}
to changefoo
tobar
. – DopeGhoti Jun 3 '16 at 6:41