Param
Parameter What does it do?
${VAR^}
${VAR==}
${VAR,}
${VAR,,}
${VAR~}
${VAR~~}
#!/usr/bin/env bash
foo() {
local value="The Quick Brown FOX Jumped over The Lazy Dog."
local -i loopCount=1000
local -i i=0
for (( i = 0; i < loopCount; ++i )); do
local newVal=""
newVal="${value,}"
printf "%s\n" "$newVal"
done
}
bar() {
local value="The Quick Brown FOX Jumped over The Lazy Dog."
local -i loopCount=1000
local -i i=0
for (( i = 0; i < loopCount; ++i )); do
local newVal=$(echo "$value" | tr '[:upper:]' '[:lower:]')
printf "%s\n" "$newVal"
done
}
baz() {
local value="$*"
printf "%s\n" "${value,,}"
}
foo
bar
baz
lower() {
printf '%s\n' "${1,,}"
}
upper() {
printf '%s\n' "${1==}"
}
reverse_case() {
printf '%s\n' "${1~~}"
}