|
Last change
on this file was 2595, checked in by bird, 12 years ago |
|
gnu grep version 2.12 (grep-2.12.tar.xz, md5sum=8d2f0346d08b13c18afb81f0e8aa1e2f)
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 1 | #! /bin/sh
|
|---|
| 2 | # Test for POSIX.2 options for grep
|
|---|
| 3 | #
|
|---|
| 4 | # Copyright (C) 2001, 2006, 2009-2012 Free Software Foundation, Inc.
|
|---|
| 5 | #
|
|---|
| 6 | # Copying and distribution of this file, with or without modification,
|
|---|
| 7 | # are permitted in any medium without royalty provided the copyright
|
|---|
| 8 | # notice and this notice are preserved.
|
|---|
| 9 | #
|
|---|
| 10 | # grep [ -E| -F][ -c| -l| -q ][-insvx] -e pattern_list
|
|---|
| 11 | # [-f pattern_file] ... [file. ..]
|
|---|
| 12 | # grep [ -E| -F][ -c| -l| -q ][-insvx][-e pattern_list]
|
|---|
| 13 | # -f pattern_file ... [file ...]
|
|---|
| 14 | # grep [ -E| -F][ -c| -l| -q ][-insvx] pattern_list [file...]
|
|---|
| 15 |
|
|---|
| 16 | . "${srcdir=.}/init.sh"; path_prepend_ ../src
|
|---|
| 17 |
|
|---|
| 18 | fail=0
|
|---|
| 19 |
|
|---|
| 20 | # checking for -E extended regex
|
|---|
| 21 | echo "abababccccccd" | grep -E -e 'c{3}' > /dev/null 2>&1
|
|---|
| 22 | if test $? -ne 0 ; then
|
|---|
| 23 | echo "Options: Wrong status code, test \#1 failed"
|
|---|
| 24 | fail=1
|
|---|
| 25 | fi
|
|---|
| 26 |
|
|---|
| 27 | # checking for basic regex
|
|---|
| 28 | echo "abababccccccd" | grep -G -e 'c\{3\}' > /dev/null 2>&1
|
|---|
| 29 | if test $? -ne 0 ; then
|
|---|
| 30 | echo "Options: Wrong status code, test \#2 failed"
|
|---|
| 31 | fail=1
|
|---|
| 32 | fi
|
|---|
| 33 |
|
|---|
| 34 | # checking for fixed string
|
|---|
| 35 | echo "abababccccccd" | grep -F -e 'c\{3\}' > /dev/null 2>&1
|
|---|
| 36 | if test $? -ne 1 ; then
|
|---|
| 37 | echo "Options: Wrong status code, test \#3 failed"
|
|---|
| 38 | fail=1
|
|---|
| 39 | fi
|
|---|
| 40 |
|
|---|
| 41 | Exit $fail
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.