summaryrefslogtreecommitdiff
path: root/hack_of_all_hacks
diff options
context:
space:
mode:
Diffstat (limited to 'hack_of_all_hacks')
-rw-r--r--hack_of_all_hacks18
1 files changed, 14 insertions, 4 deletions
diff --git a/hack_of_all_hacks b/hack_of_all_hacks
index 705beb6..11d1962 100644
--- a/hack_of_all_hacks
+++ b/hack_of_all_hacks
@@ -261,16 +261,26 @@ EOF
thing="${thing%% is *}"
is="${sentence#* is }"
- echo "${is}" >> "info/${thing}"
- send_msg "${channel_it_came_from}" "${personoslash}: Remembered."
+ if grep "^${is}$" "info/${thing}" &>/dev/null
+ then
+ send_msg "${channel_it_came_from}" "${personoslash}: I know."
+ else
+ echo "${is}" >> "info/${thing}"
+ send_msg "${channel_it_came_from}" "${personoslash}: Remembered."
+ fi
;;
"${my_own_name}: "+([![:space:]])" is: "+([![:space:]])* )
declare -l thing="${sentence#${my_own_name}: }"
thing="${thing%% is: *}"
is="${sentence#* is: }"
- echo "${is}" >> "info/${thing}"
- send_msg "${channel_it_came_from}" "${personoslash}: Remembered."
+ if grep "^${is}$" "info/${thing}" &>/dev/null
+ then
+ send_msg "${channel_it_came_from}" "${personoslash}: I know."
+ else
+ echo "${is}" >> "info/${thing}"
+ send_msg "${channel_it_came_from}" "${personoslash}: Remembered."
+ fi
;;
"${my_own_name}: "+([![:space:]])" isn't "+([![:space:]])* )
declare -l thing="${sentence#${my_own_name}: }"