#!/usr/bin/env sh6 : : sh6 - " Force sh(1), csh(1), and other shells to exit w/ error! " <'' ;;; : : " @(#)$Id: killer.sh6 410 2008-05-15 05:01:41Z jneitzel $ " : : " The author of this file, J.A. Neitzel , " : " hereby grants it to the public domain. " : : : " Ensure that the parent process (script) is invoked w/ the expected " : " name. If the basename of $1 does not match the name specified by " : " $2, send a SIGKILL (9) to this process. As a result, the parent " : " process also terminates if it is a script. Otherwise, this script " : " simply exits w/ a zero status, and the parent script continues. " : : " usage: killer $0'' Expected_script_name " : : >>$0'' <'' ; : >>$1'' <'' ; : >>$2'' <'' ; : >>$3'' <'' if X$0 = X -o X$2 = X -o X$3 != X \ if { exit } pusage killer "$0\'\'\ Expected_script_name" if { expr //$1 : '.*/\(.*\)' = $2 >/dev/null } exit perror $2 $1'": Unexpected script name"' ; kill -9 $$