Hello All,
I am new to UNIX, how do i get the First letter of each Word from a line in shell scripting.
For Example
line = "The Jack In The Box"
I want to reterive The letters T for The, J from Jack, I from In, T from The and B from Box.
and store in another string.
Can anyone please help out.
Thanks in Advance
Rahul
is this homework? if so, plz read the rules!
No this is not a homework, i was wondering how to do this.
Thanks
Rahul
one way
echo "jack in the box" | tr -s ' ' '\n' | cut -c 1
Thanks Jack for the snippet.
Regards
Rahul
line="The Jack In The Box"
firstletters=$( set -f; printf "%c " $line )
[quote]