aboutsummaryrefslogtreecommitdiffstats
path: root/gotrc-examples/allow-uppercase
blob: 17a86ce66ebc5dff8aa432c09d4184c244d9cd73 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# -*- 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.


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
}