I would like to replace the first n-letter with upper case with one sed command.
Example "madrid" in "MADrid". (N = 3)
I know how to change the first letter to uppercase with this command:
sed -e "s/\b\(.\)/\U\1/g"
but I don’t know how to change this command for my problem.
I tried to change
sed -e "s/\b\(.\)/\U\1/g"
to
sed -e "s/\b\(.\)/\U\3/g"
but it didn’t work. Also, I googled and searched on this site, but an exact answer with my problem that I could not find.
Thank.
Goran source
share