I am using ii for irc on my pogoplug...
hxxp://hg.suckless.org/ii/file/d163c8917af7/FAQ
If you look at the bottom of there, it states
31 What other fancy stuff can I do with ii?
32 ----------------------------------------
33 It is very easy to write irc bots in ii:
34 tail -f \#/out | while read foo; do name=echo $foo | awk '{print $2}' | sed 's,<\\(.*\\)>,\\1,'; if 0 -eq expr $RANDOM % 10 then echo "$name: WHAT??" ; fi; done
35 This will just spam a channel but think about using nagios2irc or you can
36 use ii to generate channel stats. Your imagination should be boundless.
Now, forgive me, but I more or less have no idea what that is doing.
My goal is to do something similiar to what this normal irc remote script will do, but with ii
on 1:TEXT:*:#channel_name:if (your_text_trigger isin $1-) { msg your_nickname_to_message from $nick ( $chan ) said $1- }
Basically, whenever someone says a trigger in a particular channel, it will message a nickname with that entire line.
The channel output is stored in a file named "out". When the trigger is stated, I'd need the name of the person who said it along with the entire line of what they said (containing the trigger as well) sent to "in" along with the command to private message it.
Is that possible with ii, from what you can see?
---------- Post updated 01-19-12 at 01:45 PM ---------- Previous update was 01-18-12 at 09:57 PM ----------
To add some clarification .....
I need to tail a particular file which is essentially a log file. Whenever I see my name, I want it to copy that entire line to a different file.
I figure I will have to use awk to do this, but beyond that I am completely lost.
tail -f outputfile | grep -w 'trigger1|trigger2|trigger3'
That should only display things that have the trigger word in them (entire line, right?).
How can I then take that line, store it to a variable, then send some text, then the variable, to another file?