Case Transformation in Bash and POSIX with Examples
How to uppercase, lowercase, and capitalize
Published in
2 min readJul 22, 2021
Bash
Use ^
to convert the first letter to uppercase and ^^
to convert all characters to uppercase.
Use ,
to convert the first letter to lowercase and ,,
to convert all characters to lowercase.
Use ~
to toggles the case for the first character and ~~
to toggle cases for all characters.
In Bash, you can do it in a different way:
You can use converting the first letter with the read
command to get the user’s response: