diff options
author | Joseph Graham <joseph@fibreglass.tunachunks> | 2013-08-27 22:19:30 +0100 |
---|---|---|
committer | Joseph Graham <joseph@fibreglass.tunachunks> | 2013-08-27 22:19:30 +0100 |
commit | 947ec8b92431279c8cbe48ce5bdd2981fc5aa271 (patch) | |
tree | fed92c42cb386154dcc2bd6b1411c17418479aab /hack_of_all_hacks | |
parent | 97aedfcb035e4b578263d235a99718f71f73c047 (diff) |
Improved how the case insensitivity works
Diffstat (limited to 'hack_of_all_hacks')
-rw-r--r-- | hack_of_all_hacks | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/hack_of_all_hacks b/hack_of_all_hacks index e16ac47..b73dcb1 100644 --- a/hack_of_all_hacks +++ b/hack_of_all_hacks @@ -10,14 +10,15 @@ function rdom function tell_fact # thing channel { thing="${1}" + declare -l lower_case_thing="${thing}" channel="${2}" - if [[ -s "info/${thing}" ]] + if [[ -s "info/${lower_case_thing}" ]] then # For the first entry we will say like: `thing is: ' first="${thing} is: " - uniq "info/${thing}" | + uniq "info/${lower_case_thing}" | while read line do send_msg "${channel}" "${first}${line}" @@ -302,7 +303,7 @@ EOF fi ;; ','+([![:space:]]) ) - declare -l thing="${sentence#,}" + thing="${sentence#,}" tell_fact "${thing}" "${channel_it_came_from}" ;; @@ -335,7 +336,7 @@ EOF dudep1="${gotit#,tell }" dude="${dudep1%% *}" - declare -l thing="${gotit##* }" + thing="${gotit##* }" if [[ -n "${dude}" ]] && [[ -n "${thing}" ]] then |