diff options
Diffstat (limited to 'gotrc-examples/allow-uppercase')
| -rw-r--r-- | gotrc-examples/allow-uppercase | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gotrc-examples/allow-uppercase b/gotrc-examples/allow-uppercase new file mode 100644 index 0000000..858fee0 --- /dev/null +++ b/gotrc-examples/allow-uppercase @@ -0,0 +1,17 @@ +# -*- shell-script -*- + + +read_function_allow_uppercase=$read_function +read_function=_read_allow_uppercase + +function _read_allow_uppercase +{ + $read_function_allow_uppercase + lower="$(sed -e 'y/QWERTYUIOPASDFGHJKLZXCVBNM/qwertyuiopasdfghjklzxcvbnm' <<< "${user}")" + if [ ! "${lower}" = "${user}" ]; then + #stty olcuc ## Uncomment this if you want to go old-school Unix, too bad + ## it will break colours and only uppercases ASCII letters. + user="${lower}" + fi +} + |
