最佳答案
The following code exits with a unbound variable error. How can I fix this, while still using the set -o
nounset option?
#!/bin/bash
set -o nounset
if [ ! -z ${WHATEVER} ];
then echo "yo"
fi
echo "whatever"