Clunch protection

Arthur David Olson ado at elsie.UUCP
Thu Oct 4 01:50:33 AEST 1984


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



More information about the Comp.unix mailing list