#!/bin/sh hg init test cd test cat >sometext.txt <getoutput.txt & sleep 5 kill `cat hg.pid` sleep 1 # wait for server to scream and die cat getoutput.txt cat access.log error.log | sed 's/^\([^[]*\[\)[^]]*\(\].*\)$/\1date\2/g'