Harlan Stenn <[EMAIL PROTECTED]>:
> 2> I'm in the habit of writing it like this: test x"$foo" != x""
> And exactly why are you using both the quotes and the x?

quotes because this fails:
  foo='hi there'
  test x$foo = xbar

x because this fails:
  foo='!'
  test "$foo" = "bar"

It's always safe to write string compares as:
  test x"$foo" = x"bar"
and it's simpler to do so uniformly than to prove whether a
particular $foo can only have safe values or not.
--

Reply via email to