VirtualBox

source: kBuild/trunk/src/grep/tests/reversed-range-endpoints@ 3646

Last change on this file since 3646 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: 468 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
5fail=0
6
7printf 'grep: Invalid range end\n' > exp
8for prog in grep 'grep -E'; do
9 # exit status must be 2, not 1
10 returns_ 2 $prog '[b-a]' < /dev/null > out 2>&1 || fail=1
11
12 # Normalize the diagnostic prefix from e.g., "/mnt/dir/grep: " to "grep: "
13 sed 's/^[^:]*: /grep: /' out > k && mv k out
14
15 compare exp out || fail=1
16done
17
18Exit $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