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

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

Re: grep


From: Alfred M. Szmidt
Subject: Re: grep
Date: 25 Jun 2002 17:28:13 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

* Holger Lehmann writes:
> I have been using grep and other standard gnu tools on my linux distribution 
> since linux-0.99pl14 ....

You probably mean a GNU/Linux distribution.  A Linux distribution
would only be an distribution of the kernel, and quite useless on its
own.  You can read about it more about this common confusion at:
http://www.gnu.org/gnu/linux-and-gnu.html

> I was working on old data. There is an example included in test.txt.
> This old data sometimes contains an "empty" row with a "backspace" (\b or ^H 
> resp. 0xa0)  at the beginning of the line.
> I wanted to skip these lines.
> My initial attempt was to grep for those lines and check the outcome:

> $ grep '^\b' < test.txt > backspace.txt

>From the info manual for grep:
 The symbol `\b' matches the empty string at the edge of a word.

Which is probobly what is happening.  Grepping for an ^H works just
fine (you can insert it with C-v C-h in bash).  The file `blah'
contains ^H's.

address@hidden:~$ grep '^^H' blah | wc -c
      5

-- 
Alfred M. Szmidt



reply via email to

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