#!/bin/sh while true; do # emu out 2>&1 emu &1 | cat >out if grep page.fault out; then exit 0; fi tail -1 out cp out out1 done