[Gllug] problems with grep

Ian Northeast ian at house-from-hell.demon.co.uk
Wed Nov 23 21:22:52 UTC 2005


charles wrote:
> All the suggestions provided thus far don't work with grep version 2.5.1 on
> Red Hat 9.

Which is a bit odd given that they work in every other common version of 
grep/shell.

> Although the original text file was written in dos I did use the following
> commands:  set fileformat=unix  and wq in vi to convert the text.

The "file" command will tell you whether a file has DOS CRLF line 
endings. Use that to check it worked properly. Some older versions of 
vim don't support "fileformat" and RH9 is pretty old now.

What happens if you create a text file directly in Linux with some "e"s 
at the end of some lines?

> I could also have used 1,$ s/^M/ / .

As quoted that would add a space to the end of every line and wouldn't work.

Regards, Ian

-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list