String Manipulation

How u convert string "hi pravin how are you?" to "Hi Pravin How Are You?"

 awk '{for(i=1;i<=NF;i++){$i=toupper(substr($i,1,1)) substr($i,2) } }1' file 

@ghostdog74

Can't this be done using tr?

---------- Post updated at 09:18 PM ---------- Previous update was at 09:11 PM ----------

echo hi praveen how are you|sed 's/ [a-z]/\U&/g'|sed 's/^[a-z]/\U&/g'
open FH,"<a.txt";
while(<FH>){
  print join " ", map {ucfirst $_} split;
  print "\n";
}
echo hi praveen how are you | sed 's/\b./\u&/g'