access first letters str bash code example Example: select first character string bash foo="bar" echo ${foo:0:1} #{str:position:length} #returns f