How do you replace the first letter of a word into Capital letter, e.g.
Trouble me
Gold rush brides
into
Trouble Me
Gold Rush Brides
Using awk
:
awk '{for(i=1;i<=NF;i++){ $i=toupper(substr($i,1,1)) substr($i,2) }}1' file
The output would be:
Trouble Me
Gold Rush Brides