#! /bin/sh # Test feature interaction of -C, -v, -o, and -m. # # Copyright (C) 2001, 2006, 2009 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. # # This set of tests was started by Charles Levert. : ${GREP=../src/grep} : ${VERBOSE=} # empty or "1" failures=0 # Lines, including terminating LF, contain 10 octets. # The words "yes" and "no" are at zero-based octet offsets of 5, 15, ... yn='yesno.txt' cat > "$yn" </dev/null; echo "?$?"; sed 's!^!X!'; } < "$yn" | tr '\n' '/'` if test "$output" != "$expect" || test "$VERBOSE" = "1"; then echo " Test #$t: { $GREP -F -n -b $opts yes; echo \"?\$?\"; sed 's!^!X!'; }" echo " output: \"$output\"" fi if test "$output" != "$expect"; then echo " expect: \"$expect\"" echo ' FAIL' failures=1 elif test "$VERBOSE" = "1"; then echo ' PASS' fi t=`expr $t + 1` done exit $failures