Jim,
its the 2nd case-- Unknown number of spaces.
I tried
tmp=`echo $var | tr -d [:space:]`
if [ ${#tmp} -eq 0 ] ; then
echo "error "
fi
But if there is a value in 'var', it did not work!.
for eg..
here's the detail requirement.----
typeset -L var ##Variable needs to be left justified, remove blank
var = "abcd1234"
echo ${#var} ==> this will show 8.
var= `get_value` ==> var gets assigned by some logic.
echo ${#var} ==> this will still show 8, irrespective of what assigned.
Here, i want to find out, if var is assigned empty, then get another value for var.
something like .. If isspace(var) then var = `get_value` else do_something_else ??
Thanks