Skip to content

Instantly share code, notes, and snippets.

@btcrooks
Last active December 6, 2015 06:19
Show Gist options
  • Save btcrooks/062ecb9f761277abbc71 to your computer and use it in GitHub Desktop.
Save btcrooks/062ecb9f761277abbc71 to your computer and use it in GitHub Desktop.
Capture and return the exit status
#!/usr/bin/env bash
#
# @description: Capture and return the exit status
#
function exitStatus() {
"${1}" "${2}" >/dev/null ; echo $?;
}
## Test all the things!!
foo=$(exitStatus "type" "mongo")
echo ${foo}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment