I have a snippet of a shell script like so -
status() {
if [ -x "$PRGDIR/qtcat_ctl.sh" ]; then
echo "Status-ing qtcat Server"
if [ -z "$QTCAT_RUNTIME_USER" ]; then
eval $PRGDIR/qtcat_ctl.sh status
else
su - $QTCAT_RUNTIME_USER -c $PRGDIR/qtcat_ctl.sh status
fi
RETVAL=$?
else
echo "Startup script $PRGDIR/qtcat_ctl.sh doesn't exist or is not executable."
RETVAL=255
fi
}
If QTCAT_RUNTIME_USER is set to "" the script runs fine but if I try to set QTCAT_RUNTIME_USER to another account the status parameter does not get passed to the qtcat_ctl.sh script.
QTCAT_RUNTIME_USERis set to the empty string. The variable is simply never set.su - user -c "/opt/QASymphony/qtest/qtest/bin/qtcat_ctl.sh status"