#!/bin/sh o=`tempfile` e=`tempfile` touch $o $e st -e tail -f $o & st -e tail -f $e & while true do read i echo "$i" | sh 2>>$e >>$o done rm -f $o $e