#!BOURNESHELL
#	program:	isequal
#	input:		two strings such as domain names, IP addrs, etc.
#	output:		"true" if they are identical regardless of case,
#			"false" if not.
#			"ERROR" is output if an error occurred.
#	exit value:	0 if "true", 1 if "false", 2 if error occurred.

if test $# -ne 2; then
	echo "usage: $0 String string" >&2
	echo 'ERROR'
	exit 2
fi

str1=$1
str2=$2

# If str1 is exactly equal to str2, then return "true" else "false".
# This is a case-less compare (ignores upper/lower case differences).

echo $str1 | grep -i \^$str2\$ > /dev/null
if test $? -eq 0; then
	echo "true"
	exit 0
else
	echo "false"
	exit 1
fi

echo 'ERROR'
exit 2
