From dd2485c1e0a6aa16585951caf3c4001c68dcc635 Mon Sep 17 00:00:00 2001 From: androiddrew Date: Mon, 26 Aug 2019 21:07:30 -0400 Subject: [PATCH] added an environment variable example --- scripts/env_example.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 scripts/env_example.sh diff --git a/scripts/env_example.sh b/scripts/env_example.sh new file mode 100755 index 0000000..8d8d15b --- /dev/null +++ b/scripts/env_example.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +# This example demonstrates that if the BASH_ENV_EX environment variable is set then it will print it out +# If not it assigns a default as an empty string which will evaluate to false. + +set -e + +if [ -n "${BASH_ENV_EX:-}" ]; then + echo $BASH_ENV_EX +else + echo "You didn't set the BASH_ENV_EX" +fi