bug-grep
[Top][All Lists]
Advanced

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

grep


From: rme
Subject: grep
Date: Fri, 26 May 2006 20:23:48 +0200
User-agent: KMail/1.8.2

Hi!

I just found out that grep is not working as desired
if the line breaks in the target file are <CR> only,
i.e. abc...xyz\o15ABC...  (no <LF>, oct 12).

I have downloaded such files from the internet; they look
o.k. when displayed in a browser or a console. But grep
does not take <CR> as a new line break; if a pattern is
found, all the rest of the entire file is taken to be
part of the "line" where the pattern was found. In the
resulting output the "line" with the pattern is written
over by all the following line segments (the same happens
if you look at the file with "more" - not so with "grep").

Example:

file data: ---x---+++y+++<CR>===z===

> grep x file.txt
===z===+++y+++
>

The biggest problem is that the file name which is output
by grep is also written over. Thus if you grep a directory
(-r option), you can not even tell which file is the culprit.
Of course, this is a rare case.

Thanks for your attention. Have a nice day!

Roland.

--//--




reply via email to

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