"You don't know where your shadow will fall", Somebody.
How to capitalize letters on bash shell script
It’s easy just use the tr command to lower, upper or capital case.
Here is an example…
1 2 3 4 5 6 7 8 9 | function toCapital { for x in $* do echo -n ${x:0:1} | tr '[a-z]' '[A-Z]' | xargs echo -n echo -n ${x:1} | tr '[A-Z]' '[a-z]' | xargs echo -n echo -n " " done } |
To test the function just call it:
1 | toCapital yuCa aMigo |
The output is:
Yuca Amigo
Hope it’s useful.
Also more information on TLDP.org:
http://www.tldp.org/LDP/abs/html/string-manipulation.html
Cheers!!!