Results 1 to 2 of 2
I am trying to detect that a command was logged in my audit logs. To accomplish this, I am just tailing the log until either the expected entry appears or ...
- 02-05-2008 #1Just Joined!
- Join Date
- Feb 2008
- Posts
- 1
Simple Expect script question
I am trying to detect that a command was logged in my audit logs. To accomplish this, I am just tailing the log until either the expected entry appears or expect times out:
However, to do this I need to send the ^C (interrupt) command after I have found the entry I am looking for, otherwise tail will sit there until the timeout. How do I send interrupts?Code:send "tail -f /var/log/messages" expect "SYSCALL=foo*uid=bar"
- 02-06-2008 #2No ya don't.I need to send the ^C (interrupt) command
What happens when you run this script?
Code:#!/bin/sh cat > dog <<EOD abcde asdf EOD cat > mouse <<EOD 12345 qwerty EOD expect <<EOD spawn tail -f dog set timeout 10 expect asdf EOD expect <<EOD spawn tail -f mouse set timeout 10 expect asdf EOD
--
Bill
Old age and treachery will overcome youth and skill.


Reply With Quote