config root man

Current Path : /compat/linux/proc/self/root/usr/src/gnu/usr.bin/grep/tests/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //compat/linux/proc/self/root/usr/src/gnu/usr.bin/grep/tests/empty.sh

#!/bin/sh
# test that the empty file means no pattern
# and an empty pattern means match all.

: ${srcdir=.}

failures=0

for options in '-E' '-E -w' '-F -x' '-G -w -x'; do

	# should return 0 found a match
	echo "" | ${GREP} $options -e '' > /dev/null 2>&1
	if test $? -ne 0 ; then
		echo "Status: Wrong status code, test \#1 failed ($options)"
		failures=1
	fi

	# should return 1 found no match
	echo "abcd" | ${GREP} $options -f /dev/null  > /dev/null 2>&1
	if test $? -ne 1 ; then
		echo "Status: Wrong status code, test \#2 failed ($options)"
		failures=1
	fi

	# should return 0 found a match
	echo "abcd" | ${GREP} $options -f /dev/null -e "abcd" > /dev/null 2>&1
	if test $? -ne 0 ; then
		echo "Status: Wrong status code, test \#3 failed ($options)"
		failures=1
	fi
done

exit $failures

Man Man