On Oct 19, 2018, at 10:12 AM, Osamu Tatebe via IO-500 <io-500(a)vi4io.org> wrote:
Hi,
io500_fixed.sh seems to have a bug.
./bin/io500_fixed.sh: line 48: !V: unbound variable
Here are lines in io500_fixed.sh
47: for V in $important_vars; do
48: [ -z "${!V}" -o "${!V}" = "xxx" ] &&
49: echo "Need to set '$V' in io500.sh" && exit 1
50: done
Why ${!V} instead of ${V}?
The "${!V}" syntax means "print the variable whose name
is stored in "$V". In this case, $important_vars holds
a list of variable names that need to be set for io500
to run properly, and this code is an efficient way to
check that all of them are set.
Are you running on a system that does not use bash, or
a very old version of bash that doesn't handle ${!VAR}?
Cheers, Andreas