Skip to content

Instantly share code, notes, and snippets.

@mtdeguzis
Created September 18, 2018 00:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtdeguzis/a6464bff942934c64607698218590710 to your computer and use it in GitHub Desktop.
Save mtdeguzis/a6464bff942934c64607698218590710 to your computer and use it in GitHub Desktop.
#!/bin/bash
# If specified value is true, return valid
# Else return invalid
#
# Allows concatenation via && and ||
evaluate_boolean() {
if [ "${1}" == "True" ] || \
[ "${1}" == "true" ] || \
[ "${1}" == "1" ]; then
return 0
else
return 1
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment