VirtualBox

source: kBuild/vendor/grep/2.12/tests/options

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
18fail=0
19
20# checking for -E extended regex
21echo "abababccccccd" | grep -E -e 'c{3}' > /dev/null 2>&1
22if test $? -ne 0 ; then
23 echo "Options: Wrong status code, test \#1 failed"
24 fail=1
25fi
26
27# checking for basic regex
28echo "abababccccccd" | grep -G -e 'c\{3\}' > /dev/null 2>&1
29if test $? -ne 0 ; then
30 echo "Options: Wrong status code, test \#2 failed"
31 fail=1
32fi
33
34# checking for fixed string
35echo "abababccccccd" | grep -F -e 'c\{3\}' > /dev/null 2>&1
36if test $? -ne 1 ; then
37 echo "Options: Wrong status code, test \#3 failed"
38 fail=1
39fi
40
41Exit $fail
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette