| Line |  | 
|---|
| 1 | #!/bin/sh | 
|---|
| 2 | # Test for POSIX.2 options for grep | 
|---|
| 3 | # | 
|---|
| 4 | # grep [ -E| -F][ -c| -l| -q ][-insvx] -e pattern_list | 
|---|
| 5 | #      [-f pattern_file] ... [file. ..] | 
|---|
| 6 | # grep [ -E| -F][ -c| -l| -q ][-insvx][-e pattern_list] | 
|---|
| 7 | #      -f pattern_file ... [file ...] | 
|---|
| 8 | # grep [ -E| -F][ -c| -l| -q ][-insvx] pattern_list [file...] | 
|---|
| 9 | # | 
|---|
| 10 |  | 
|---|
| 11 | : ${srcdir=.} | 
|---|
| 12 |  | 
|---|
| 13 | failures=0 | 
|---|
| 14 |  | 
|---|
| 15 | # checking for -E extended regex | 
|---|
| 16 | echo "abababccccccd" | ${GREP} -E -e 'c{3}' > /dev/null 2>&1 | 
|---|
| 17 | if test $? -ne 0 ; then | 
|---|
| 18 | echo "Options: Wrong status code, test \#1 failed" | 
|---|
| 19 | failures=1 | 
|---|
| 20 | fi | 
|---|
| 21 |  | 
|---|
| 22 | # checking for basic regex | 
|---|
| 23 | echo "abababccccccd" | ${GREP} -G -e 'c\{3\}' > /dev/null 2>&1 | 
|---|
| 24 | if test $? -ne 0 ; then | 
|---|
| 25 | echo "Options: Wrong status code, test \#2 failed" | 
|---|
| 26 | failures=1 | 
|---|
| 27 | fi | 
|---|
| 28 |  | 
|---|
| 29 | # checking for fixed string | 
|---|
| 30 | echo "abababccccccd" | ${GREP} -F -e 'c\{3\}' > /dev/null 2>&1 | 
|---|
| 31 | if test $? -ne 1 ; then | 
|---|
| 32 | echo "Options: Wrong status code, test \#3 failed" | 
|---|
| 33 | failures=1 | 
|---|
| 34 | fi | 
|---|
| 35 |  | 
|---|
| 36 | exit $failures | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.