Convert GUI text selections, in place, from UPPER to lower case, etc

How about plain bash 4 (no awk, sed):


string="abc def 123"

# lower
clip="${string,,}"; echo "lower: $clip"

# Upper
clip="${string^^}"; echo "upper: $clip"

# capital 1st letter
string="${string,,}"; IFS=" " read -r -a array <<< "$string"; cliparr=( "${array[@]^*}" ); echo "capital: ${cliparr[*]}"
# ^ doesn't support multiline, see ˇ the new script that uses awk instead

Full script for key bindings: