< BACK

Bash tips, tricks and code snippets

Convert string between lowercase and uppercase

Using tr:

T="Hello World"
echo "$T" | tr '[:upper:]' '[:lower:]'

or using awk:

echo "$T" | awk '{print tolower($0)}'

produce

hello world

See reference here.