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