#!/bin/bash # wait for a string to appear at the end of file # tridge@samba.org July 2008 [ $# -lt 3 ] && { cat < $tmpfile spawn tail -n 10000 -f $file expect -timeout $timeout -re "$msg" EOF export LANG=C expect $tmpfile rm -f $tmpfile if ! grep -E "$msg" $file > /dev/null; then echo "Failed to find \"$msg\" in $file" exit 1 fi exit 0