From f5faacf250d7c5da5c1e4ebe53d84d2bf788b72f Mon Sep 17 00:00:00 2001 From: Vivia Nikolaidou Date: Tue, 5 Nov 2013 15:34:05 +0200 Subject: Fix nickname and channel detection * Nicknames were assumed to be in [A-Za-z] format. Just detecting a [^!] now as ! separates the nickname from the host. * Channels may start with two hashes, the previous regexp didn't recognize that. --- shbot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shbot.sh') diff --git a/shbot.sh b/shbot.sh index 066d202..0deee12 100755 --- a/shbot.sh +++ b/shbot.sh @@ -11,7 +11,7 @@ do if [[ "$LINE" =~ PING\ *:(.*) ]]; then echo "PONG :${BASH_REMATCH[1]}" >&3 else - [[ ${LINE} =~ :[a-zA-Z]*!.*(#.*)\ :.* ]] && ORIGIN=${BASH_REMATCH[1]} + [[ ${LINE} =~ :[^!]*![^#]*(#.*)\ :.* ]] && ORIGIN=${BASH_REMATCH[1]} echo "${LINE}" | ./shbrain.sh | \ while true do -- cgit v1.2.3