I am running following test bash script:
test.sh
========
pass=$1
if [ $pass -eq 1 ]; then
exit 0
else
exit 1
fi
=============
So, If I run './test.sh 1', it should give me success code, i.e. 0. And if I run './test.sh 2' it should give me specific error code, i.e. 1.
But when I run the script, I am getting 0 as exit code for both the cases.
Output
========================
# ./test.sh 1 |echo $?
0
# ./test.sh 2 |echo $?
0
#
=========================
What am I doing wrong here? Any help will be greatly appreciated!
Noman A.