Hi I am calling a shell script from inside another shell script and if that script call goes successful I have to proceed further and I am using sh command to call another script like :
sh payloadjob.sh
if [[ $? -eq 0 ]]; then
echo Success message
else
echo Failure message
fi
But I am noticing that even script call go successful it gives Exit status as 1 however it should return 0 for success why it is happening and how do I come to know that script call via sh command is successful or not ?
If
is different fromif
. I assume that wasn't the issue here, since you would have got a syntax error (or an error aboutIf
not found)[[ ]]
. Now the question just is, ifpayloadjob.sh
even returns a sane return value.