How to Convert a String to Lower Case in Bash
Is There a Way in Bash to Convert a String into a Lower Case String? for Example, If I Have: A="Hi All" I Want to Convert It to: "Hi All" 1 26 Answers the Are...
Is there a way in bash to convert a string into a lower case string?
For example, if I have:
a="Hi all"
I want to convert it to:
"hi all"
26 Answers
The are various ways:
Must Read
POSIX standard
tr
$ echo "$a" | tr '[:upper:]' '[:lower:]'
hi all
AWK
$ echo "$a" | awk '{print tolower($0)}'
hi all