I am trying to take some text that is all lowercase i.e. firstname.lastname and using awk
, make it capital First.Last. The problem I'm seeing is the period needs to come through as a literal character, and the last name needs to be capitalized.
I have tried using sed, but was unsuccessful as it is in a macOS script.
I looked here Changing the case of a string with awk
but was unable to have any success
echo 'first.last' | awk '{print toupper(substr($0,1,1)) tolower(substr($0,2)) }'
This code was the closest I got, but the result came out as First.last
I would like to see the output as First.Last