wo way to get length of the string.
The simplest one is ${#varname}, which returns the length of the v... r is null, return bar. export foo=""
echo ${foo:-one}
one
echo $foo
${foo:=bar} If $foo exists and is not null, return $foo. If it doesn't exist or is n... to bar and return bar export foo=""
echo ${foo:=one}
one
echo $foo
one
${foo:+bar} If $foo exists