Upper and lower casing

Many people use external commands such as tr and awk for uppercasing and lowercasing strings, but this is not necessary. BASH 4 and later can do this all by itself.

To upper case

jira_key=foo-2343
printf "%s\n" ${jira_key^^}

Result:

FOO-2343

To lower case

jira_key=FOO-2343
printf "%s\n" ${jira_key,,}

Result:

foo-2343

~ /home 🏠 ~ talks 💬 ~ bash ~ craftsmanship ~ db ~ dongxi ~ emacs ~ escenic ~ iam ~ java ~ js ~ language ~ latex ~ ldap ~ life ~ linux ~ llm ~ mac-os-x ~ mt-foo ~ network ~ norsk ~ python ~ quotes ~ running ~ security ~ travel ~ unix ~ various ~ vcs ~ webdesign ~ windows ~ discoveries ~ cv 🧙 ~

Licensed under CC BY Creative Commons License ~ 📡 RSS feed ~ ✉ torstein.k.johansen @ gmail ~ 🐘 @skybert@hachyderm.io ~ 🎥 youtube.com/@skybert