I have a Bash variable, $word
, which is sometimes a word or sentence, e.g.:
word="tiger"
Or:
word="This is a sentence."
How can I make a new Bash variable which is equal to only the first letter found in the variable? E.g., the above would be:
echo $firstletter
t
Or:
echo $firstletter
T
-c
option in POSIX head: <unix.com/man-page/posix/1/head>. – Dirge