This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

tail file & exec question

Old posts that have not been replied to for several years.
Locked
d
difoo
Voice
Posts: 33
Joined: Sat Jul 03, 2004 9:56 am

tail file & exec question

Post by difoo »

hi,

i managed to have the bot parse the output of a specific file in realtime. but when i try to have him output only specific lines out of it, it only gives me errors. here's what i use:

set fileout [exec cat $file | grep -E 'sshd|kernel']
putserv "PRIVMSG $chan :$fileout"

i dont want alot of spam in my chan and only want to see lines containing sshd & kernel but all i get is:

[21:59] child process exited abnormally
while executing
"exec cat $file | grep -E 'sshd|kernel'"

the part below works like a charm, but outputs ANY line that gets written to the file i'm tailing:

set fileout [exec cat $file]
putserv "PRIVMSG $chan :$fileout"

any help on this?

difoo
User avatar
incith
Master
Posts: 275
Joined: Sat Apr 23, 2005 2:16 am
Location: Canada

Post by incith »

Try

Code: Select all

.. grep -e ssh -e kernel
HTH.
p
pollar
Voice
Posts: 18
Joined: Thu Jan 09, 2003 12:20 pm
Location: Lithuania

Post by pollar »

Code: Select all

set fileout [exec cat $file | grep -E "sshd|kernel"]
Locked