Take a look at 'test' (type 'man test' for info). [ -z "$foo" ] is true if the length of $foo is zero [ -n "$foo" ] is true if the length of $foo is non-zero I've found this to be more reliable than [ $foo ] or X"$foo" = X Jay G. Heiser