bug-gnu-utils
[Top][All Lists]
Advanced

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

bug in grep regarding


From: Vijay Seshadri
Subject: bug in grep regarding
Date: Thu, 12 Jul 2001 15:46:16 -0700
User-agent: Mozilla/5.0 (X11; U; Linux 2.4.2-2 i686; en-US; 0.7) Gecko/20010316

Bug report for GNU grep:
1. grep version number: 2.4.2
2. No patches made(used the binary)
3. Machine type, OS etc: Redhat Linux 7.1, Pentium III 996Mhz single processor, Linux kernel 2.4.4-2
4.  No compiling done, used binary directly
5. grep -E '[]mz]' test.c

where test.c was

int main()
{
  fprintf(stdout,"This [goes to standard out\n");
  fprintf(stderr,"This ]goes to standard error\n");
  fprintf(stderr,"This -goes to standard error\n");
  fprintf(stderr,"This ^goes to standard error\n");
}

OutPut seen:

int main()

Output expected:

int main()
      fprintf(stderr,"This ]goes to standard error\n");

Problem Explanation: The Character ']' cannot be used inside a character list. The GNU documentation says that to use this in a character list, put it in the beginning of the list. The same is the observation for '^' character.(which the doc says should in anywhere but first)
BTW, the same command works fine in solaris.

Please reply with resolution and comments if possible,

Vijay




reply via email to

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