Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84; site elsie.UUCP Path: utzoo!linus!decvax!wivax!cadmus!harvard!seismo!umcp-cs!cvl!elsie!ado From: ado@elsie.UUCP (Arthur David Olson) Newsgroups: net.unix Subject: Clunch protection Message-ID: <4005@elsie.UUCP> Date: Wed, 3-Oct-84 11:50:33 EDT Article-I.D.: elsie.4005 Posted: Wed Oct 3 11:50:33 1984 Date-Received: Fri, 5-Oct-84 08:26:06 EDT Organization: NIH-LEC, Bethesda, MD Lines: 26 At the top of "sh" files in the "rn" distribution this line was included: export PATH || (echo "You didn't use sh, you clunch." ; kill \$\$) This was designed to ensure that if someone ran "csh" over the script things would come to a screeching halt. Seeing it set me to thinking...what if, instead of that line, this appeared: export PATH || exec sh $0 You'd get the protection without requiring the user to retype the command. You could even go so far as to: ( : oops >& /dev/null ) || exec sh $0 to avoid the both the generation of a diagnostic message and the possibility of mishap if someone had created an executable program named "export". Well friends, how about it? Such protection might make folks lives easier. Is it worthwhile? Is there a better way to do it? Mail me your responses; if there's sufficient volume, I'll summarize them in a followup article. -- ..decvax!seismo!elsie!ado (301) 496-5688 DEC, VAX and Elsie are Digital Equipment and Borden trademarks