#!/bin/csh -f
#!/bin/csh -fxv
#
# A simple wrap for a grep statement
#
# If a file is not found, this insults the user instead of giving
# a normal error message.
# Note: Please don't write insulting programs
if ( $#argv < 2 ) then
	echo "Idiot, RTFM and try again"
	exit 1
else if ( ! -e $argv[2] ) then
	echo "Stupid, this file doesn't even exist, can't you evun type?"
	exit 2
else if ( ! -r $argv[2] ) then
	echo -n "Fool, you're supposed to know that you can't "
	echo "grep if you can't read the file"
	exit 3
else 
# Use double quotes to hold arguments with a space together
	grep "$1" $2
#	grep $1 $2
	if ( $status == "1" ) echo "$1" not matched in $2
	exit 0
endif

