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

Answer Posted / vipul dalwala

echo "hi pravin how are you?" | awk 'BEGIN { ORS = ""
upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
lower = "abcdefghijklmnopqrstuvwxyz" }
{
for (i = 1; i <= NF; i++) {
FC = substr($i, 1, 1)
if (C = index(lower, FC))
FC = substr(upper, C, 1)
print FC substr($i,2) " "
}
print "\n"
}'

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a boot block?

587


What will happen to my current process when I execute a command using exec?

539


Explain about debugging?

606


What's the difference between scripting and coding?

599


What does egrep mean?

577






What are script files?

555


In my bash shell I want my prompt to be of format '$"present working directory":"hostname"> and load a file containing a list of user-defined functions as soon as I log in, how will you automate this?

641


What is ms powershell?

585


What does echo $0 do?

591


What is a scripting language simple definition?

562


What is a command line shell?

567


one folder contains lot of students name but I want to fetch hello with every student name individually using shell script

522


How to pass an argument to a script?

596


wats the deinitions for shell utility and filter?

1849


What language is shell scripting?

581