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
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
# awk '{for(i=1;i<=NF;i++){ $i=toupper(substr($i,1,1)) substr($i,2) }}1' file
Trouble Me
Gold Rush Brides
Use the following sed command for capitalizing the first letter of the each word.
echo -e "Trouble me \nGold rush brides" | sed -r 's/\<./\U&/g'
output
Trouble Me
Gold Rush Brides