get length of the string.
The simplest one is ${#varname}, which returns the length of the value of the variable as a character string. For example, if filen... ther operator (${#array[*]}) has to do with array variables.
==== String Length ====
<code>
${#string} ... = Default =====
These operators can be used in a variety of ways. A good example would be to give a de
<code>
String='' # Zero-length ("null") string variable.
if [ -z "$String" ]
then
ech... arithmetic and string comparisons,
#+ since Bash variables are not strongly typed.
# Bash permits integer operations and comparisons on variables
#+ whose value consists of all-integer char... if [ ${filename##*.} != "gz" ]
# Using bracket in variable substitution.
then
echo "File $1 is not a