Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Oct 2001 16:19:28 +0200 (CEST)
From:      Stefan `Sec` Zehl <sec@ice.42.org>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   docs/31431: grep manpage is incorrect regarding _GNU_nonoption_argv_flags_
Message-ID:  <20011022141928.604F9383@ice.42.org>

next in thread | raw e-mail | index | archive | help

>Number:         31431
>Category:       docs
>Synopsis:       grep manpage is incorrect regarding _GNU_nonoption_argv_flags_
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 22 07:20:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Stefan `Sec` Zehl
>Release:        FreeBSD 4.4-STABLE i386
>Organization:
>Environment:
System: FreeBSD ice 4.4-STABLE FreeBSD 4.4-STABLE #9: Sat Sep 29 19:25:00 CEST 2001 root@ice:/usr/export/obj/usr/export/src/sys/ICE i386


	
>Description:

The grep manpage states under ENVIRONMENT VARIABLES:

       _N_GNU_nonoption_argv_flags_
              (Here N is grep's numeric process ID.)  If the  ith
              character  of  this environment variable's value is
              1, do not consider the ith operand of grep to be an
              option,  even if it appears to be one.  A shell can
              put this variable in the environment for each  com­
              mand  it  runs,  specifying  which operands are the
              results of file name wildcard expansion and  there­
              fore should not be treated as options.  This behav­
              ior is available only with the GNU C  library,  and
              only when POSIXLY_CORRECT is not set.

As far as I can see, this is incorrect, since out getopt() does not fetch
this environment variable.

>How-To-Repeat:

(echo "foobar";echo "-G")|\
perl -e '
$ENV{"_".$$."_GNU_nonoption_argv_flags_"}="1";
exec "/usr/bin/grep","-G";
'

which should grep for "-G" but doesn't.

Further evidence is, that neither the source, nor the binary
contains the string "_GNU_nonoption_argv_flags_"

yoda:/usr/src/gnu/usr.bin/grep>grep _GNU_nonoption_argv_flags_ *.[ch]
yoda:/usr/src/gnu/usr.bin/grep>

and

yoda:~>ldd /usr/bin/grep
/usr/bin/grep:
        libgnuregex.so.2 => /usr/lib/libgnuregex.so.2 (0x28070000)
        libz.so.2 => /usr/lib/libz.so.2 (0x28078000)
        libc.so.4 => /usr/lib/libc.so.4 (0x28086000)

yoda:~>strings -a /usr/bin/grep /usr/lib/libgnuregex.so.2 /usr/lib/libz.so.2 /usr/lib/libc.so.4|grep _GNU_nonoption_argv_flags_
yoda:~>


	
>Fix:

remove that section from the manpage?
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011022141928.604F9383>