I'm trying to write a grub2 bootloader script but if statements always evaluate to true:
if [ -s blabla ] ; then set zzz0="1" ; fi
if [ ! -s blabla ] ; then set zzz1="1" ; fi
set TEST_VAR=foo
if [ "x${TEST_VAR}" = "xfoo" ] ; then set zzz2="1" ; fi
if [ "x${TEST_VAR}" = "xbar" ] ; then set zzz3="1" ; fi
if [ $TEST_VAR = foo ] ; then set zzz4="1" ; fi
if [ $TEST_VAR = bar ] ; then set zzz5="1" ; fi
So, after running this script, I see all zzz (zzz0, zzz1, zzz2, zzz3, zzz4, zzz5)variables set to 1. What am I doing wrong?
Thanks, Johnny