How to obtain the first letter in a Bash variable? How to obtain the first letter in a Bash variable? bash bash

How to obtain the first letter in a Bash variable?


initial="$(echo $word | head -c 1)"

Every time you say "first" in your problem description, head is a likely solution.