ength of the string.
The simplest one is ${#varname}, which returns the length of the value of the va... able as a character string. For example, if filename has the value fred.c, then ${#filename} would have the value 6.
The other operator (${#array[*]}) h... Index
expr index $string $substring
</code>
Numerical position in $string of first character in $s
ays quote a tested string.
=== Example 7-5. Arithmetic and string comparisons ===
<code>
#!/bin/bash... ated either as integers or strings.
# There is some blurring between the arithmetic and string comparisons,
#+ since Bash variables are not strongly type... then
echo "$a is not equal to $b"
echo "(arithmetic comparison)"
fi
echo
if [ "$a" != "$b" ]
the