Suppose you have following variables in your shell
str="foobar"
and you want to output the length of this string (length of this string is 6) then run the following command
echo ${#str}
str="foobar"
and you want to output the length of this string (length of this string is 6) then run the following command
echo ${#str}