Last active
March 2, 2017 11:35
-
-
Save bamdadd/daa90d884454a3c15b8f9427ae57456a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function exit_code { | |
local OUTPUT="$(docker ps -n 1 --format '{{.Status}}' | tr "\(" " " | tr "\)" " " | awk '{print $2}')" | |
exit ${OUTPUT:1:1} | |
} | |
docker ps ubuntu /bin/true | |
exit_code | |
docker ps ubuntu /bin/false | |
exit_code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
test with $?