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