In bash when I try to check for null or empty i get syntax error message
DEFAULT_VALUE="0"
CRAM_QUERY=$(mycommand)
if [[ "$CRAM_QUERY" == "NULL" ] || ["$CRAM_QUERY" == ""]] ; then
CRAM_QUERY="$DEFAULT_VALUE"
fi
In bash when I try to check for null or empty i get syntax error message
DEFAULT_VALUE="0"
CRAM_QUERY=$(mycommand)
if [[ "$CRAM_QUERY" == "NULL" ] || ["$CRAM_QUERY" == ""]] ; then
CRAM_QUERY="$DEFAULT_VALUE"
fi
This should work:
DEFAULT_VALUE="0"
CRAM_QUERY=$(mycommand)
if [[ "$CRAM_QUERY" == "NULL" || "$CRAM_QUERY" == "" ]] ; then
CRAM_QUERY="$DEFAULT_VALUE"
fi