|
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:
438 bytes
|
| Line | |
|---|
| 1 | #!/bin/sh
|
|---|
| 2 | # Ensure that an invalid range like [b-a] evokes exit status of 2.
|
|---|
| 3 | . "${srcdir=.}/init.sh"; path_prepend_ ../src
|
|---|
| 4 |
|
|---|
| 5 | fail=0
|
|---|
| 6 |
|
|---|
| 7 | printf 'Invalid range end\n' > exp
|
|---|
| 8 | for prog in grep egrep 'grep -E'; do
|
|---|
| 9 | $prog '[b-a]' < /dev/null > out 2>&1
|
|---|
| 10 | # exit status must be 2, not 1
|
|---|
| 11 | test $? = 2 || fail=1
|
|---|
| 12 |
|
|---|
| 13 | # Remove "$prog: " prefix from actual output.
|
|---|
| 14 | sed 's/^[grep]*: //' out > k && mv k out
|
|---|
| 15 |
|
|---|
| 16 | compare exp out || fail=1
|
|---|
| 17 | done
|
|---|
| 18 |
|
|---|
| 19 | Exit $fail
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.