>>>>> "Bengt" == Bengt Ohman <[EMAIL PROTECTED]> writes:
> This is generally a bad idea, since if the left hand side evaluates
> to nothing, you get a test that looks like "if [ != '-']", which
> confuses the shell.
Not quite: The empty arg problem is solved by using double-quotes
(so that it really evaluates to an argument of length zero rather than to zero
args). So something like
if [ "$foo" != "$bar" ]; then
should work fine if $foo is empty. The reason to add a "x" is to avoid the
case where $foo = "-f" (for instance) where you might end up evaluating a
different test than the one you expected.
Stefan