For example, if filename has the value fred.c, then ${#filename} would have the value 6.
The other ... == Substr ====
Shell uses zero-based indexing. When substring expansion of the form ${param:offset[:l... from the end of the expanded value of $param.
When a negative `offset' begins with a minus sign, however, unexpected things can happen. Consider
<code>
a=12345678
echo ${a:-4}
</co
) string variable.
if [ -z "$String" ]
then
echo "\$String is null."
else
ech... rackets. Using an unquoted string with ! -z, or even just the unquoted string alone within test bracke... tegers or strings.
# There is some blurring between the arithmetic and string comparisons,
#+ since B... n advised, however.
echo
if [ "$a" -ne "$b" ]
then
echo "$a is not equal to $b"
echo "(arithmeti