Debian Codegraph @

tests/word-multi-file

raw
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
6 mkdir 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
14 cat << \EOF > exp1 || framework_failure_
15 a/1:aa bb cc
16 a/2:bb dd ff
17 a/4:bb xx zz
18 EOF
19 sed s/..// exp1 > exp2 || framework_failure_
20
21 fail=0
22 grep -rw bb a > out || fail=1
23 sort < out > k; mv k out
24 compare exp1 out || fail=1
25
26 (cd a && grep -w bb [1-4]) > out || fail=1
27 compare exp2 out || fail=1
28
29 Exit $fail