wo way to get length of the string.
The simplest one is ${#varname}, which returns the length of the v... i%l} already exists
else
mv $i ${i%l}
fi
done
Substitution
Another kind of variable mangling y... 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
ing with ! -z, or even just the unquoted string alone within test brackets (see Example 7-6) normally w... # This works fine.
# The [ ... ] test operator alone detects whether the string is null.
# However it ... Chazelas points out,
# if [ $string1 ] has one argument, "]"
# if [ "$string1" ] has two arg