Page
bash | string | uppercase | lowercase
Using Bash Parameter Expansion
Lowercase Conversion
To convert a string to lowercase, use the {variable,,} syntax:
Output:
Uppercase Conversion
To convert a string to uppercase, use the {variable^^} syntax:
Output:
Using the `tr` Command
The tr (translate) command is a versatile tool for transforming text. It can be used for case conversion by specifying the input and output character sets:
Lowercase Conversion
Output:
Uppercase Conversion
Output:
Last updated