shell脚本,请求解释
#!/bin/csh
# EndM5
# Do a proper end and shutdown of Mark5A or $1, if any
# Revised: 2002 January 25, JAB
#
if ( "$1" == "" ) then
set name = Mark5A
else
set name = "$1"
endif
set tst = ` ps -ax | grep -E -v "grep|$0:t" | grep $name `
if ( ${#tst} > 0 ) then
echo "$0:t sending INTERRUPT to $name $tst[1] "
kill -INT $tst[1]
else
echo "${0:t} ERROR: Can't find program $name "
exit ( -1 )
endif