bug-grep
[Top][All Lists]
Advanced

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

Re: bug with grep?


From: Bob Proulx
Subject: Re: bug with grep?
Date: Mon, 16 Nov 2009 21:24:11 -0700
User-agent: Mutt/1.5.18 (2008-05-17)

Wolfram R. Jarisch wrote:
> I found somewhat surprising that
> # man gcc | grep m64
> does not produce any output but
> # man gcc | grep 64
> does. What do I miss? The "m" is not an option - "-m" is...

You did not say anything about what operating system you were using
nor what version of grep and so the best anyone can do is to guess at
the problem.  I will guess the problem is formatting in the man page.
The actual characters may have formating around them that you are not
immediately aware of without looking further.  For example there may
be overstriking with backspaces.  In which case the result could look
like "m^Hm^Hm^Hm" or similar.  Using 'col -b' is often a source of
relief here as in 'man gcc | col -b | grep m64'.  This is just a guess.

The way to debug what is happening is to save the result in a file and
then edit the file with an editor that shows you every character and
then finding the section that you are looking for and examining the
characters there.  At that point the reason will be obvious.

  $ man gcc > gcc.man.out
  $ $EDITOR gcc.man.out

What operating system are you using?  That will give clues as to the
nature of any 'man' formatting.  What version of 'grep'?

  $ man gcc | grep m64
             -mcmodel=code-model -m32  -m64 -mlarge-data-threshold=num
             -mno-fp-in-toc  -mno-sum-in-toc -m64  -m32  -mxl-compat
             -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle -m64  -m31
             -m32  -m64  -mapp-regs  -mno-app-regs -mfaster-structs
         -m64
             AMD’s x86-64 architecture. For darwin only the -m64 option turns
         -m64
         -m64
             for S/390 ABI.  When -m64 is specified, generate code compliant to
             -m31, while the s390x targets default to -m64.
             is not possible with -m64.  When generating code compliant to the
         -m64

Works for me on my Debian GNU/Linux system.

Bob




reply via email to

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