bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Test yesno fail with GNU sed 3.02


From: gmail
Subject: Test yesno fail with GNU sed 3.02
Date: Thu, 14 Apr 2011 00:03:22 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9

Hello,

This is my first contact and mail with this mailing list, to summarize i'm a coder maintening a personnal home server using several GNU tools since the late 90's.

I build GREP-2.7 in a chroot jail (gcc 4.5.2/libc 2.13/binutils 2.21/make 3.82) with an athlon architecture on ext3 FS and, as root, got one failed test on tests/yesno :

    address@hidden mkdir grep-2.7_build && cd grep-2.7_build

    address@hidden ../grep-2.7/configure

    address@hidden make

    address@hidden make check

    ....

    make  check-TESTS
    make[2]: Entering directory `/usr/src/grep-2.7_build/tests'
    make[3]: Entering directory `/usr/src/grep-2.7_build/tests'
    PASS: backref
    PASS: backref-word
    PASS: bre
    PASS: backref-multibyte-slow
    PASS: case-fold-backref
    PASS: case-fold-backslash-w
    PASS: case-fold-char-class
    PASS: case-fold-char-range
    PASS: case-fold-char-type
    PASS: char-class-multibyte
    PASS: dfaexec-multibyte
    PASS: empty
    PASS: ere
    PASS: equiv-classes
    PASS: euc-mb
    PASS: fedora
    PASS: fgrep-infloop
    PASS: file
    PASS: fmbtest
    PASS: foad1
    PASS: grep-dev-null
    XFAIL: grep-dir
    PASS: help-version
    PASS: ignore-mmap
    PASS: include-exclude
    PASS: khadafy
    PASS: max-count-vs-context
    PASS: options
    PASS: pcre
    PASS: pcre-z
    PASS: reversed-range-endpoints
    sjis-mb: skipped test: SJIS locale not found
    SKIP: sjis-mb
    PASS: spencer1
    PASS: spencer1-locale
    PASS: status
    PASS: prefix-of-multibyte
    PASS: warn-char-classes
    PASS: word-multi-file
    XFAIL: word-delim-multibyte
    FAIL: yesno
    ========================================
       GNU grep 2.7: tests/test-suite.log
    ========================================

    1 of 39 tests failed.  (1 test was not run).

    .. contents:: :depth: 2


    SKIP: sjis-mb (exit: 77)
    ========================

    ....

    FAIL: yesno (exit: 1)
    =====================

    ++ initial_cwd_=/usr/src/grep-2.7_build/tests
    +++ testdir_prefix_
    +++ printf gt
    ++ pfx_=gt
    +++ mktempd_ /usr/src/grep-2.7_build/tests gt-yesno.XXXX
    +++ case $# in
    +++ destdir_=/usr/src/grep-2.7_build/tests
    +++ template_=gt-yesno.XXXX
    +++ MAX_TRIES_=4
    +++ case $destdir_ in
    +++ case $template_ in
    +++ fail=0
    ++++ unset TMPDIR
    ++++ mktemp -d -t -p /usr/src/grep-2.7_build/tests gt-yesno.XXXX
    +++ d=/usr/src/grep-2.7_build/tests/gt-yesno.WS0c
    +++ case $d in
    +++ test -d /usr/src/grep-2.7_build/tests/gt-yesno.WS0c
    ++++ tr S -
    ++++ ls -dgo /usr/src/grep-2.7_build/tests/gt-yesno.WS0c
+++ perms='drwx------ 2 4096 Apr 13 21:41 /usr/src/grep-2.7_build/tests/gt-yesno.W-0c'
    +++ case $perms in
    +++ test 0 = 0
    +++ echo /usr/src/grep-2.7_build/tests/gt-yesno.WS0c
    +++ return
    ++ test_dir_=/usr/src/grep-2.7_build/tests/gt-yesno.WS0c
    ++ cd /usr/src/grep-2.7_build/tests/gt-yesno.WS0c
    ++ for sig_ in 1 2 3 13 15
    +++ expr 1 + 128
    ++ eval 'trap '\''Exit 129'\'' 1'
    +++ trap 'Exit 129' 1
    ++ for sig_ in 1 2 3 13 15
    +++ expr 2 + 128
    ++ eval 'trap '\''Exit 130'\'' 2'
    +++ trap 'Exit 130' 2
    ++ for sig_ in 1 2 3 13 15
    +++ expr 3 + 128
    ++ eval 'trap '\''Exit 131'\'' 3'
    +++ trap 'Exit 131' 3
    ++ for sig_ in 1 2 3 13 15
    +++ expr 13 + 128
    ++ eval 'trap '\''Exit 141'\'' 13'
    +++ trap 'Exit 141' 13
    ++ for sig_ in 1 2 3 13 15
    +++ expr 15 + 128
    ++ eval 'trap '\''Exit 143'\'' 15'
    +++ trap 'Exit 143' 15
    ++ trap remove_tmp_ 0
    + path_prepend_ ../src
    + test 1 '!=' 0
    + path_dir_=../src
    + case $path_dir_ in
    ++ cd /usr/src/grep-2.7_build/tests/../src
    ++ echo /usr/src/grep-2.7_build/src
    + abs_path_dir_=/usr/src/grep-2.7_build/src
    + case $abs_path_dir_ in
+ PATH=/usr/src/grep-2.7_build/src:/usr/src/grep-2.7_build/src:/usr/src/grep-2.7_build:.:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
    + create_exe_shims_ /usr/src/grep-2.7_build/src
    + case $EXEEXT in
    + return 0
    + shift
    + test 0 '!=' 0
    + export PATH
    + : yes
    + failures=0
    + yn=yesno.txt
    + cat
    + A='1:0:[A01 no ]/'
    + rA='1-0-[A01 no ]/'
    + XA='X[A01 no ]/'
    + B='2:10:[B02 no ]/'
    + rB='2-10-[B02 no ]/'
    + XB='X[B02 no ]/'
    + C='3:20:[C03 yes]/'
    + rC='3-20-[C03 yes]/'
    + XC='X[C03 yes]/'
    + c=3:25:yes/
    + rc=3-25-yes/
    + D='4:30:[D04 yes]/'
    + rD='4-30-[D04 yes]/'
    + XD='X[D04 yes]/'
    + d=4:35:yes/
    + rd=4-35-yes/
    + E='5:40:[E05 yes]/'
    + rE='5-40-[E05 yes]/'
    + XE='X[E05 yes]/'
    + e=5:45:yes/
    + re=5-45-yes/
    + F='6:50:[F06 no ]/'
    + rF='6-50-[F06 no ]/'
    + XF='X[F06 no ]/'
    + G='7:60:[G07 no ]/'
    + rG='7-60-[G07 no ]/'
    + XG='X[G07 no ]/'
    + H='8:70:[H08 yes]/'
    + rH='8-70-[H08 yes]/'
    + XH='X[H08 yes]/'
    + h=8:75:yes/
    + rh=8-75-yes/
    + I='9:80:[I09 yes]/'
    + rI='9-80-[I09 yes]/'
    + XI='X[I09 yes]/'
    + i=9:85:yes/
    + ri=9-85-yes/
    + J='10:90:[J10 no ]/'
    + rJ='10-90-[J10 no ]/'
    + XJ='X[J10 no ]/'
    + K='11:100:[K11 no ]/'
    + rK='11-100-[K11 no ]/'
    + XK='X[K11 no ]/'
    + L='12:110:[L12 no ]/'
    + rL='12-110-[L12 no ]/'
    + XL='X[L12 no ]/'
    + M='13:120:[M13 yes]/'
    + rM='13-120-[M13 yes]/'
    + XM='X[M13 yes]/'
    + m=13:125:yes/
    + rm=13-125-yes/
    + N='14:130:[N14 yes]/'
    + rN='14-130-[N14 yes]/'
    + XN='X[N14 yes]/'
    + n=14:135:yes/
    + rn=14-135-yes/
    + s=--/
    + S=XYZ/
    + z0='?0/'
    + z1='?1/'
    + z2='?2/'
    ....

    + t=27
    + test xx '!=' x-4,-1
    ++ sed 's/,/ /g'
    ++ echo -4,-1
    + opts='-4 -1'
+ expect='2-10-[B02 no ]/3:20:[C03 yes]/4:30:[D04 yes]/5:40:[E05 yes]/6-50-[F06 no ]/7-60-[G07 no ]/8:70:[H08 yes]/9:80:[I09 yes]/10-90-[J10 no ]/--/12-110-[L12 no ]/13:120:[M13 yes]/14:130:[N14 yes]/?0/'
    + shift 2
    ++ tr '\n' /
    ++ grep -F -n -b -4 -1 yes
    ++ echo '?0'
    ++ sed 's!^!X!'
+ output='2-10-[B02 no ]/3:20:[C03 yes]/4:30:[D04 yes]/5:40:[E05 yes]/6-50-[F06 no ]/7-60-[G07 no ]/8:70:[H08 yes]/9:80:[I09 yes]/10-90-[J10 no ]/--/12-110-[L12 no ]/13:120:[M13 yes]/14:130:[N14 yes]/?0/X[A01 no ]/X[B02 no ]/X[C03 yes]/X[D04 yes]/X[E05 yes]/X[F06 no ]/X[G07 no ]/X[H08 yes]/X[I09 yes]/X[J10 no ]/X[K11 no ]/X[L12 no ]/X[M13 yes]/X[N14 yes]/' + test '2-10-[B02 no ]/3:20:[C03 yes]/4:30:[D04 yes]/5:40:[E05 yes]/6-50-[F06 no ]/7-60-[G07 no ]/8:70:[H08 yes]/9:80:[I09 yes]/10-90-[J10 no ]/--/12-110-[L12 no ]/13:120:[M13 yes]/14:130:[N14 yes]/?0/X[A01no ]/X[B02 no ]/X[C03 yes]/X[D04 yes]/X[E05 yes]/X[F06 no ]/X[G07 no ]/X[H08 yes]/X[I09 yes]/X[J10 no ]/X[K11 no ]/X[L12 no ]/X[M13 yes]/X[N14 yes]/' '!=' '2-10-[B02 no ]/3:20:[C03 yes]/4:30:[D04 yes]/5:40:[E05 yes]/6-50-[F06 no ]/7-60-[G07 no ]/8:70:[H08 yes]/9:80:[I09 yes]/10-90-[J10 no ]/--/12-110-[L12 no ]/13:120:[M13 yes]/14:130:[N14 yes]/?0/' + echo ' Test #27: { grep -F -n -b -4 -1 yes; echo "?$?"; sed '\''s!^!X!'\''; }'
     Test #27:  { grep -F -n -b -4 -1 yes; echo "?$?"; sed 's!^!X!'; }
+ echo ' output: "2-10-[B02 no ]/3:20:[C03 yes]/4:30:[D04 yes]/5:40:[E05 yes]/6-50-[F06 no ]/7-60-[G07 no ]/8:70:[H08 yes]/9:80:[I09 yes]/10-90-[J10 no ]/--/12-110-[L12 no ]/13:120:[M13 yes]/14:130:[N14 yes]/?0/X[A01 no ]/X[B02 no ]/X[C03 yes]/X[D04 yes]/X[E05 yes]/X[F06 no ]/X[G07 no ]/X[H08 yes]/X[I09 yes]/X[J10 no ]/X[K11 no ]/X[L12 no ]/X[M13 yes]/X[N14 yes]/"' output: "2-10-[B02 no ]/3:20:[C03 yes]/4:30:[D04 yes]/5:40:[E05 yes]/6-50-[F06 no ]/7-60-[G07 no ]/8:70:[H08 yes]/9:80:[I09 yes]/10-90-[J10 no ]/--/12-110-[L12 no ]/13:120:[M13 yes]/14:130:[N14 yes]/?0/X[A01 no ]/X[B02 no ]/X[C03 yes]/X[D04 yes]/X[E05 yes]/X[F06 no ]/X[G07 no ]/X[H08 yes]/X[I09 yes]/X[J10 no ]/X[K11 no ]/X[L12 no ]/X[M13 yes]/X[N14 yes]/" + test '2-10-[B02 no ]/3:20:[C03 yes]/4:30:[D04 yes]/5:40:[E05 yes]/6-50-[F06 no ]/7-60-[G07 no ]/8:70:[H08 yes]/9:80:[I09 yes]/10-90-[J10 no ]/--/12-110-[L12 no ]/13:120:[M13 yes]/14:130:[N14 yes]/?0/X[A01no ]/X[B02 no ]/X[C03 yes]/X[D04 yes]/X[E05 yes]/X[F06 no ]/X[G07 no ]/X[H08 yes]/X[I09 yes]/X[J10 no ]/X[K11 no ]/X[L12 no ]/X[M13 yes]/X[N14 yes]/' '!=' '2-10-[B02 no ]/3:20:[C03 yes]/4:30:[D04 yes]/5:40:[E05 yes]/6-50-[F06 no ]/7-60-[G07 no ]/8:70:[H08 yes]/9:80:[I09 yes]/10-90-[J10 no ]/--/12-110-[L12 no ]/13:120:[M13 yes]/14:130:[N14 yes]/?0/' + echo ' expect: "2-10-[B02 no ]/3:20:[C03 yes]/4:30:[D04 yes]/5:40:[E05 yes]/6-50-[F06 no ]/7-60-[G07 no ]/8:70:[H08 yes]/9:80:[I09 yes]/10-90-[J10 no ]/--/12-110-[L12 no ]/13:120:[M13 yes]/14:130:[N14 yes]/?0/"' expect: "2-10-[B02 no ]/3:20:[C03 yes]/4:30:[D04 yes]/5:40:[E05 yes]/6-50-[F06 no ]/7-60-[G07 no ]/8:70:[H08 yes]/9:80:[I09 yes]/10-90-[J10 no ]/--/12-110-[L12 no ]/13:120:[M13 yes]/14:130:[N14 yes]/?0/"
    + echo '    FAIL'
        FAIL
    + failures=1
    ++ expr 27 + 1
    + t=28

    ....

    + echo '    FAIL'
        FAIL
    + failures=11

    ....

    ++ expr 37 + 1
    + t=38
    + test xx '!=' x-m,3,-v,-C,1,-o
    ++ sed 's/,/ /g'
    ++ echo -m,3,-v,-C,1,-o
    + opts='-m 3 -v -C 1 -o'
+ expect='3-25-yes/--/5-45-yes/?0/X[G07 no ]/X[H08 yes]/X[I09 yes]/X[J10 no ]/X[K11 no ]/X[L12 no ]/X[M13 yes]/X[N14 yes]/'
    + shift 2
    ++ tr '\n' /
    ++ grep -F -n -b -m 3 -v -C 1 -o yes
    ++ echo '?0'
    ++ sed 's!^!X!'
+ output='3-25-yes/--/5-45-yes/?0/X[A01 no ]/X[B02 no ]/X[C03 yes]/X[D04 yes]/X[E05 yes]/X[F06 no ]/X[G07 no ]/X[H08 yes]/X[I09 yes]/X[J10 no ]/X[K11 no ]/X[L12 no ]/X[M13 yes]/X[N14 yes]/' + test '3-25-yes/--/5-45-yes/?0/X[A01 no ]/X[B02 no ]/X[C03 yes]/X[D04 yes]/X[E05 yes]/X[F06 no ]/X[G07 no ]/X[H08 yes]/X[I09 yes]/X[J10 no ]/X[K11 no ]/X[L12 no ]/X[M13 yes]/X[N14 yes]/' '!=' '3-25-yes/--/5-45-yes/?0/X[G07 no ]/X[H08 yes]/X[I09 yes]/X[J10 no ]/X[K11 no ]/X[L12 no ]/X[M13 yes]/X[N14 yes]/' + echo ' Test #38: { grep -F -n -b -m 3 -v -C 1 -o yes; echo "?$?"; sed '\''s!^!X!'\''; }' Test #38: { grep -F -n -b -m 3 -v -C 1 -o yes; echo "?$?"; sed 's!^!X!'; } + echo ' output: "3-25-yes/--/5-45-yes/?0/X[A01 no ]/X[B02 no ]/X[C03 yes]/X[D04 yes]/X[E05 yes]/X[F06 no ]/X[G07 no ]/X[H08 yes]/X[I09 yes]/X[J10 no ]/X[K11 no ]/X[L12 no ]/X[M13 yes]/X[N14 yes]/"' output: "3-25-yes/--/5-45-yes/?0/X[A01 no ]/X[B02 no ]/X[C03 yes]/X[D04 yes]/X[E05 yes]/X[F06 no ]/X[G07 no ]/X[H08 yes]/X[I09 yes]/X[J10 no ]/X[K11 no ]/X[L12 no ]/X[M13 yes]/X[N14 yes]/" + test '3-25-yes/--/5-45-yes/?0/X[A01 no ]/X[B02 no ]/X[C03 yes]/X[D04 yes]/X[E05 yes]/X[F06 no ]/X[G07 no ]/X[H08 yes]/X[I09 yes]/X[J10 no ]/X[K11 no ]/X[L12 no ]/X[M13 yes]/X[N14 yes]/' '!=' '3-25-yes/--/5-45-yes/?0/X[G07 no ]/X[H08 yes]/X[I09 yes]/X[J10 no ]/X[K11 no ]/X[L12 no ]/X[M13 yes]/X[N14 yes]/' + echo ' expect: "3-25-yes/--/5-45-yes/?0/X[G07 no ]/X[H08 yes]/X[I09 yes]/X[J10 no ]/X[K11 no ]/X[L12 no ]/X[M13 yes]/X[N14 yes]/"' expect: "3-25-yes/--/5-45-yes/?0/X[G07 no ]/X[H08 yes]/X[I09 yes]/X[J10 no ]/X[K11 no ]/X[L12 no ]/X[M13 yes]/X[N14 yes]/"
    + echo '    FAIL'
        FAIL
    + failures=1
    ++ expr 38 + 1
    + t=39
    + test xx '!=' xx
    + Exit 1
    + set +e
    + exit 1
    + exit 1
    + remove_tmp_
    + __st=1
    + cleanup_
    + :
    + cd /usr/src/grep-2.7_build/tests
    + chmod -R u+rwx /usr/src/grep-2.7_build/tests/gt-yesno.WS0c
    + rm -rf /usr/src/grep-2.7_build/tests/gt-yesno.WS0c
    + exit 1
    =================================
    1 of 39 tests failed
    (1 test was not run)
    See tests/test-suite.log
    Please report to address@hidden
    =================================
    make[3]: Leaving directory `/usr/src/grep-2.7_build/tests'
    make[2]: Leaving directory `/usr/src/grep-2.7_build/tests'
    make[1]: Leaving directory `/usr/src/grep-2.7_build/tests'

    address@hidden


This log lets me guess that the issue has something to do with the sed when i check the #38 test.
The #38 test expects the output

"3-25-yes/--/5-45-yes/?0/X[G07 no ]/X[H08 yes]/X[I09 yes]/X[J10 no ]/X[K11 no ]/X[L12 no ]/X[M13 yes]/X[N14 yes]/"

but it got the output

"3-25-yes/--/5-45-yes/?0/X[A01 no ]/X[B02 no ]/X[C03 yes]/X[D04 yes]/X[E05 yes]/X[F06 no ]/X[G07 no ]/X[H08 yes]/X[I09 yes]/X[J10 no ]/X[K11 no ]/X[L12 no ]/X[M13 yes]/X[N14 yes]/"

from

     grep -F -n -b -m 3 -v -C 1 -o yes
     echo '?0'
     sed 's!^!X!'

It seems that sed command should had dropped the fields A/B/C/D/E/F . I look then after the sed command that was used for the build :


    address@hidden sed --version

    GNU sed version 3.02

    Copyright (C) 1998 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,
    to the extent permitted by law.



This one seem a bit outdated, but i have not seen any specific requirement for the sed command regarding grep 2.7, with the exception that grep 2.7 require a POSIX compliant safe environment. Therefore, i get sed 4.2, build it in the chroot environment and launch the grep 2.7 tests suite with sed 4.2 in the PATH variable :



    address@hidden export PATH="/usr/src/sed-4.2_build:$PATH"

    address@hidden sed --version

    GNU sed version 4.2
    Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,
    to the extent permitted by law.

    GNU sed home page: <http://www.gnu.org/software/sed/>.
    General help using GNU software: <http://www.gnu.org/gethelp/>.
    E-mail bug reports to: <address@hidden>.
Be sure to include the word ``sed'' somewhere in the ``Subject:'' field.

    address@hidden make check


    ....

    make  check-TESTS
    make[2]: Entering directory `/usr/src/grep-2.7_build/tests'
    make[3]: Entering directory `/usr/src/grep-2.7_build/tests'
    PASS: backref
    PASS: backref-word
    PASS: bre
    PASS: backref-multibyte-slow
    PASS: case-fold-backref
    PASS: case-fold-backslash-w
    PASS: case-fold-char-class
    PASS: case-fold-char-range
    PASS: case-fold-char-type
    PASS: char-class-multibyte
    PASS: dfaexec-multibyte
    PASS: empty
    PASS: ere
    PASS: equiv-classes
    PASS: euc-mb
    PASS: fedora
    PASS: fgrep-infloop
    PASS: file
    PASS: fmbtest
    PASS: foad1
    PASS: grep-dev-null
    XFAIL: grep-dir
    PASS: help-version
    PASS: ignore-mmap
    PASS: include-exclude
    PASS: khadafy
    PASS: max-count-vs-context
    PASS: options
    PASS: pcre
    PASS: pcre-z
    PASS: reversed-range-endpoints
    sjis-mb: skipped test: SJIS locale not found
    SKIP: sjis-mb
    PASS: spencer1
    PASS: spencer1-locale
    PASS: status
    PASS: prefix-of-multibyte
    PASS: warn-char-classes
    PASS: word-multi-file
    XFAIL: word-delim-multibyte
    PASS: yesno
    ======================================================
    All 39 tests behaved as expected (2 expected failures)
    (1 test was not run)
    ======================================================

    ....

    ======================
    All 87 tests passed
    (2 tests were not run)
    ======================
    make[5]: Leaving directory `/usr/src/grep-2.7_build/gnulib-tests'
    make[4]: Leaving directory `/usr/src/grep-2.7_build/gnulib-tests'
    make[3]: Leaving directory `/usr/src/grep-2.7_build/gnulib-tests'
    make[2]: Leaving directory `/usr/src/grep-2.7_build/gnulib-tests'
    make[1]: Leaving directory `/usr/src/grep-2.7_build/gnulib-tests'
    make[1]: Entering directory `/usr/src/grep-2.7_build'
    make[1]: Nothing to be done for `check-am'.
    make[1]: Leaving directory `/usr/src/grep-2.7_build'

    address@hidden





I have studied a little the yesno test and i can make a resume of the failed test :

    address@hidden cat > x <<EOF

    [A01 no ]
    [B02 no ]
    [C03 yes]
    [D04 yes]
    [E05 yes]
    [F06 no ]
    [G07 no ]
    [H08 yes]
    [I09 yes]
    [J10 no ]
    [K11 no ]
    [L12 no ]
    [M13 yes]
    [N14 yes]
    EOF

    address@hidden cp /usr/src/sed-4.2_build/sed sed.new

address@hidden X=$( { src/grep -F -n -b -m 3 -v -C 1 -o yes ; echo "?$?" ; sed 's!^!X!' ; } < x | tr '\n' '/')

    address@hidden echo $X

3-25-yes/--/5-45-yes/?0/X[A01 no ]/X[B02 no ]/X[C03 yes]/X[D04 yes]/X[E05 yes]/X[F06 no ]/X[G07 no ]/X[H08 yes]/X[I09 yes]/X[J10 no ]/X[K11 no ]/X[L12 no ]/X[M13 yes]/X[N14 yes]/

address@hidden X=$( { src/grep -F -n -b -m 3 -v -C 1 -o yes ; echo "?$?" ; sed.new 's!^!X!' ; } < x | tr '\n' '/')

    address@hidden echo $X

3-25-yes/--/5-45-yes/?0/X[G07 no ]/X[H08 yes]/X[I09 yes]/X[J10 no ]/X[K11 no ]/X[L12 no ]/X[M13 yes]/X[N14 yes]/

    address@hidden



I suspect that this behavior results from the grep "-m 3" option :

       -m NUM, --max-count=NUM
Stop reading a file after NUM matching lines. If the input is standard input from a regular file, and NUM matching lines are output, grep ensures that the standard input is positioned to just after the last matching line before exiting, regardless of the presence of trailing context lines. This enables a calling process to resume a search. When grep stops after NUM matching lines, it outputs any trailing context lines. When the -c or --count option is also used, grep does not output a count greater than NUM. When the -v or --invert-match option is also
              used, grep stops after outputting NUM non-matching lines.


I guess that grep 2.7 positions the standard input after the line "[F06 no ]",
having reached 3 "yes" matches. The GNU sed 4.2 command reads standard input
in a way that is affected, the GNU sed 3.02 command reads its input in a way that is
not affected.

The GNU sed 3.02 command was built on another environment than the chroot,
perhaps there is here a link.

If you think that this worth it, i can investigate further.

Regards, Cedric.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]