VirtualBox

source: kBuild/vendor/grep/2.12/tests/word-multi-file

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: 623 bytes
Line 
1#!/bin/sh
2# exercise the -w option on multiple files
3# Derived from http://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.

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