#!/bin/csh -f # # Author: Ram Samudrala (me@ram.org) # Version: O1.0 # Detail: # April 6, 1994. # # See the URL above for more information. # # replace_plan: This kills the current `plan` process and restarts # another one. This is useful if you have made changes # in the variable or fixed regions of your plan file. # This assumes the "plan" program is in your path # someplace. # # Usage : replace_plan [-i] # -i gives you the option of replacing a process interactively. # # change to reflect the number files that contain quotes. set NUM_QUOTES = "57" set $user = `whoami` # ps -fu works on SGI systems. ps -aux might work better on other systems. # set pid = `ps -fu $user | grep "plan" | grep -v "replace" | grep -v "grep" | awk '{print $2}'` if ($1 == "-i") then echo `ps -fu $user | grep "plan" | grep -v "replace" | grep -v "grep"` echo -n "Kill $pid? [y/n] " set answer = `echo -n $<` if (`echo -n $answer` == "y") then echo "killing $pid..." kill -9 $pid plan $NUM_QUOTES & endif else kill -9 $pid plan $NUM_QUOTES & endif #