aboutsummaryrefslogtreecommitdiffstats
path: root/gotrc-examples/allow-uppercase
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-09-30 23:29:44 +0200
committerMattias Andrée <maandree@operamail.com>2013-09-30 23:29:44 +0200
commit89f8903bc5b942211c95e3a1dfdf1d030be8596d (patch)
tree169e8232171e24e6a317e83701f59081a8eb72da /gotrc-examples/allow-uppercase
parentderp (diff)
downloadgates-of-tartaros-89f8903bc5b942211c95e3a1dfdf1d030be8596d.tar.gz
gates-of-tartaros-89f8903bc5b942211c95e3a1dfdf1d030be8596d.tar.bz2
gates-of-tartaros-89f8903bc5b942211c95e3a1dfdf1d030be8596d.tar.xz
portability
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'gotrc-examples/allow-uppercase')
-rw-r--r--gotrc-examples/allow-uppercase8
1 files changed, 4 insertions, 4 deletions
diff --git a/gotrc-examples/allow-uppercase b/gotrc-examples/allow-uppercase
index a54c5f6..aa13d07 100644
--- a/gotrc-examples/allow-uppercase
+++ b/gotrc-examples/allow-uppercase
@@ -6,17 +6,17 @@
read_function_allow_uppercase=$read_function
read_function=_read_allow_uppercase
-function _read_allow_uppercase
+_read_allow_uppercase ()
{
$read_function_allow_uppercase
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}")"
+ if [ ! "${word%%-*}" = "" ]; then # This check is done so SSH arguments are not made into lower case
+ word="$(echo "${word}" | sed -e 'y/QWERTYUIOPASDFGHJKLZXCVBNM/qwertyuiopasdfghjklzxcvbnm/')"
fi
lower="${lower} ${word}"
done
- lower="${lower:1}"
+ lower="${lower# *}"
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.