get first characters string bash code example
Example 1: select first character string bash
foo="bar"
echo ${foo:0:1}
#{str:position:length}
#returns f
Example 2: bash get first n characters
echo ${FOO:0:10}
foo="bar"
echo ${foo:0:1}
#{str:position:length}
#returns f
echo ${FOO:0:10}