VirtualBox

source: kBuild/trunk/src/grep/tests/word-multi-file

Last change on this file was 3529, checked in by bird, 3 years ago

Imported grep 3.7 from grep-3.7.tar.gz (sha256: c22b0cf2d4f6bbe599c902387e8058990e1eee99aef333a203829e5fd3dbb342), applying minimal auto-props.

  • Property svn:executable set to *
File size: 624 bytes
Line 
1#!/bin/sh
2# exercise the -w option on multiple files
3# Derived from https://bugzilla.redhat.com/570500
4. "${srcdir=.}/init.sh"; path_prepend_ ../src
5
6mkdir a || framework_failure_
7( cd a \
8 && echo aa bb cc > 1 \
9 && echo bb dd ff > 2 \
10 && echo ff gg hh > 3 \
11 && echo bb xx zz > 4 \
12) || framework_failure_
13
14cat << \EOF > exp1 || framework_failure_
15a/1:aa bb cc
16a/2:bb dd ff
17a/4:bb xx zz
18EOF
19sed s/..// exp1 > exp2 || framework_failure_
20
21fail=0
22grep -rw bb a > out || fail=1
23sort < out > k; mv k out
24compare exp1 out || fail=1
25
26(cd a && grep -w bb [1-4]) > out || fail=1
27compare exp2 out || fail=1
28
29Exit $fail
Note: See TracBrowser for help on using the repository browser.

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