Bash check if environment variable is set
Bash check if environment variable is set
When writing bash scripts, it is sometimes necessary to check if an environment bariable is set.
The following command will print hello
if the environment variable HELLO
is set:
[[ -z ${HELLO}]] || echo "hello"