I am trying to capitalize each first letter of the first word in each sentence from a txt file called input.txt and I want this input file to be a argument of the shell script
./script.sh input.txt
sample input file:
i am Andrew. you are Jhon. here we are, forever.
result file:
I am Andrew. You are Jhon. Here we are, forever.
A special case. What if our text is (related to @RaduRadeanu answer)
i am andrew. you
are jhon. here we are
forever
the result would be:
I am andrew. You
Are jhon. Here we are
Forever.
So it convert to uppercase each first word of each sentence and also each first word of new line. How do we skip over uppercase first word of new line?
So the correct result must be:
I am andrew. You
are jhon. Here we are
forever.
What if the sentence closes in "?" or "!" ???