I’ve got the following script:
#!/bin/bash
if [[ ${DISABLE_WORK} -ne "0" ]];
then
echo "exiting"
exit 0
fi
echo "doing something"
The output is:
case 1:
$ DISABLE_WORK=1 ./if.sh
exiting
case 2:
$ DISABLE_WORK=2 ./if.sh
exiting
case 3:
$ DISABLE_WORK=0 ./if.sh
doing something
case 4:
$ ./if.sh
doing something
I searched the documentation and still can not figure out why case 4 produces ‘doing something’ instead of ‘exiting’. Could someone explain, please?
1