URL:
  <http://savannah.gnu.org/bugs/?31702>

                 Summary: command line option '--include' acts as '--exclude'
                 Project: grep
            Submitted by: hunteke
            Submitted on: Thu 18 Nov 2010 10:26:10 PM GMT
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

I've read the pertinent areas of the man page a couple of times, but I may
yet just not be understanding something.  However, it appears that --include
acts the same as --exclude.  Test case:

-----
$ grep --version | head -1
GNU grep 2.6.3

$ dpkg -l | grep grep
ii  grep        2.6.3-3        GNU grep, egrep and fgrep

$ mkdir test; cd test
$ cat > test.c
#include <stdio.h>

int main ( ) {
  printf( "Test\n" );

  return ( 0 );
}

$ ln test.c test.cxx
$ ln test.c test.cpp
$ ls
test.c  test.cpp  test.cxx

$ grep main * --exclude="*.c"
test.cpp:int main ( ) {
test.cxx:int main ( ) {

$ grep main * --include="*.c"
test.cpp:int main ( ) {
test.cxx:int main ( ) {
-----

Am I missing something really simple?




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?31702>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


Reply via email to