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

Using set -A write a script to print the output of the ls command in 5 columns with two spaces between each column. Pretend that ls does not have multicolumn output.

2029


What is a shell script in windows?

583


Explain about the slow execution speed of shells?

770


State the advantages of shell scripting?

592


What is ms powershell?

579






wats the deinitions for shell utility and filter?

1838


What is path in shell script?

636


What are the different types of shell scripting?

532


What is c in shell script?

627


What is the use of "$#" in shell scripting?

549


What is the use of echo in shell script?

537


What is the use of .sh file?

597


What is scripting used for?

553


What language is used in terminal?

554


What is the default shell of solaris?

565