[ILUG] quoting bash strings

Braun Brelin bbrelin at gmail.com
Fri Dec 10 14:15:25 GMT 2010


Hello all,

Does anyone know the reason why I have to quote strings when testing them
like so?

s1="foo"

if [ -n "$s1" ]; then
   echo blah
fi

i.e. why the "$s1" in the test expression?  Anyone know the answer?

Thanks,

braun


More information about the ILUG mailing list