2 # Test for status code for GNU grep.
12 # should return 0 found a match
13 echo "abcd" | ${GREP} -E -e 'abc' > /dev/null 2>&1
14 if test $? -ne 0 ; then
15 echo "Status: Wrong status code, test \#1 failed"
19 # should return 1 found no match
20 echo "abcd" | ${GREP} -E -e 'zbc' > /dev/null 2>&1
21 if test $? -ne 1 ; then
22 echo "Status: Wrong status code, test \#2 failed"
26 # the filename MMMMMMMM.MMM should not exist hopefully
27 # should return 2 file not found
28 if test -b MMMMMMMM.MMM; then
29 echo "Please remove MMMMMMMM.MMM to run check"
31 ${GREP} -E -e 'abc' MMMMMMMM.MMM> /dev/null 2>&1
32 if test $? -ne 2 ; then
33 echo "Status: Wrong status code, test \#3 failed"