sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 4fd3fbed4a4a4bb16dadd49af71bc7be6a364221
parent 3a1546ef8b4b9994e711027c628934a996f653a1
Author: Ivan c00kiemon5ter Kanakarakis <ivan.kanak@gmail.com>
Date:   Fri, 13 Jul 2012 01:30:27 +0300

iibots: no need for a subprocess awk and all that - plain sh will do
Diffstat:
Mtools.suckless.org/ii/bots.md | 13++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/tools.suckless.org/ii/bots.md b/tools.suckless.org/ii/bots.md @@ -1,12 +1,11 @@ Its very easy to write shell script based bots with ii. As a short example look at this: - tail -f \\#<CHANNEL>/out | - while read foo ; do - name=$(echo $foo | awk '{print $2}' | sed 's,<\\(.*\\)>,\\1,') - if awk 'BEGIN{srand(); exit rand()<.1)}' ; then - echo "$name: WHAT??" ; - fi; - done + tail -f \\#<CHANNEL>/out | + while read -r date time nick mesg; do + nick="${nick#<}" + nick="${nick%>}" + printf "%s: WHAT??\n" "$nick" + done > \\#<CHANNEL>/in Its just spamming a channel but I guess your imagination is boundless. I also heard about people using it together with nagios to get the notifications into IRC.