[Gllug] problems with grep

Nix nix at esperi.org.uk
Wed Nov 23 21:10:09 UTC 2005


On Wed, 23 Nov 2005, charles suggested tentatively:
> All the suggestions provided thus far don't work with grep version 2.5.1 on
> Red Hat 9.

Well, they work with *my* grep 2.5.1. grep has had bugs, but a bug as
enormous as $ not working would have failed most of grep's own testsuite
and never have been released.

(Well, OK, that depends upon locale to some degree, but unless you're
using Basque or something it'd probably have still been spotted.)

> 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. I could
> also have used
> 1,$ s/^M/ / .

What does `od -a' say about the line endings? are they `cr lf' or just
`lf'?

'Cos I just checked, and grep does indeed not autoconvert DOS files for
you unless you're actually running under DOS, and this has exactly the
symptoms you're seeing. (See the description of the effect of the
`--binary' option in the grep info page.)

-- 
`Y'know, London's nice at this time of year. If you like your cities
 freezing cold and full of surly gits.' --- David Damerell

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




More information about the GLLUG mailing list