I have a script (run-docker-container.sh) that calls another script (create-docker-container.sh). create-docker-container executes a curl script against the docker remote api and returns the http code or zero if successful. The create script returns thus-wise
echo $RVAL exit $RVAL
and in my tests has the value for $RVAL as 404, the value I'm interested in for this question.
In my run-docker-container script, I have the following lines
create-docker-container.sh $CONTAINER_NAME $CONTAINER_SETTINGS rval=$? echo $rval if [ $rval -eq 404 ]; then ... fi
even though create appears to be exiting with 404, the value I'm getting for
$? is 148 and thus my condition handling is not being called.
Why would this be and how do I properly get the exit code from the script?