String length of bash

bash, shell

Solution

This can be done natively in bash, no need to resort to `expr`

echo ${#Str}

Problem

I have written this to find the length of the string, but it doesn't show the length of the string. Is there something wrong with what I have written? I'm just a beginner in bash. ``` Str=abcdefghj echo "Str is:" `expr length $Str` "characters long" ```

Original source

Related problems