Anonymous
public text v1 · immutable#!/usr/bin/env bash
if [ $# != 2 ] ; then
echo "usage: $0 <timeout> <message to look for>"
exit 1
fi
tail -f /var/log/messages | grep --line-buffered $2 >/tmp/foo &
sleep $1
kill %1
if grep $2 /tmp/foo >/dev/null ; then
echo "found it"
exit 0
else
echo "didn't find it"
exit 1
fi