#!/bin/csh setenv CLASSPATH . foreach i (*.html) echo $i appletviewer $i & sleep 10; set pid=`ps -ef | grep "AppletViewer $i" | head -1 | awk '{print $2}'` echo pid = $pid kill $pid end