Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Check for variables defined in bash script
for var in MY_ENV_VAR_1 MY_ENV_VAR_2; do
if [[ -z "${!var:-}" ]];
then
echo "You need to provide a value for env variable $var"
exit 1
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.