Bash String to Lower or Upper Case

From NovaOrdis Knowledge Base
Revision as of 01:32, 11 December 2019 by Ovidiu (talk | contribs) (→‎bash 4)
Jump to navigation Jump to search

Internal

tr

echo "${text}" | tr '[:upper:]' '[:lower:]'

awk

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

bash 4

sed

echo "${text}" | sed -e 's/\(.*\)/\L\1/'