diff options
| author | Mattias Andrée <maandree@operamail.com> | 2013-09-30 08:28:24 +0200 |
|---|---|---|
| committer | Mattias Andrée <maandree@operamail.com> | 2013-09-30 08:28:24 +0200 |
| commit | 3e6605c1da199a48c9e6214cc4680b79d21aac87 (patch) | |
| tree | 19dc6db59facf330d1c3a59f892bca7d8beddd73 | |
| parent | update makefile (diff) | |
| download | gates-of-tartaros-3e6605c1da199a48c9e6214cc4680b79d21aac87.tar.gz gates-of-tartaros-3e6605c1da199a48c9e6214cc4680b79d21aac87.tar.bz2 gates-of-tartaros-3e6605c1da199a48c9e6214cc4680b79d21aac87.tar.xz | |
preserve ssh flags' casing when converting username to lower case
Signed-off-by: Mattias Andrée <maandree@operamail.com>
| -rw-r--r-- | gotrc-examples/allow-uppercase | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gotrc-examples/allow-uppercase b/gotrc-examples/allow-uppercase index 17a86ce..a54c5f6 100644 --- a/gotrc-examples/allow-uppercase +++ b/gotrc-examples/allow-uppercase @@ -1,8 +1,6 @@ # -*- shell-script -*- -# The module allows you to use upper case letters when login in, however, arguments -# passed to external programs, like ssh, defined by the user in the login line -# will be converted to lower case. +# The module allows you to use upper case letters when login in. read_function_allow_uppercase=$read_function @@ -11,7 +9,14 @@ read_function=_read_allow_uppercase function _read_allow_uppercase { $read_function_allow_uppercase - lower="$(sed -e 'y/QWERTYUIOPASDFGHJKLZXCVBNM/qwertyuiopasdfghjklzxcvbnm' <<< "${user}")" + lower="" + for word in $user; do + if [ ! "${word::1}" = "-" ]; then # this check is done so ssh arguments are not made into lower case + word="$(sed -e 'y/QWERTYUIOPASDFGHJKLZXCVBNM/qwertyuiopasdfghjklzxcvbnm/' <<< "${word}")" + fi + lower="${lower} ${word}" + done + lower="${lower:1}" 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. |
