bug-textutils
[Top][All Lists]
Advanced

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

Re: cat


From: Bob Proulx
Subject: Re: cat
Date: Sun, 19 May 2002 11:52:23 -0600

Thanks for the report.  But I am not able to recreate your failing
test case.  It worked fine for me on both HP-UX and Linux running
recent versions of the GNU utilities.

You did not include the operating system that you were running on nor
the versions of the utilities involved.  That would be required in
order to make further progress at debugging this.  However I see in a
small snippet:

> For the time being I have replaced cat.exe with a shell script as follows:

The fact that you are running cat.exe with a .exe ending leads me to
believe you are running a port of the GNU operating system utilities
on a MS-Windows system.  Perhaps you are using the Cygwin toolkit and
perhaps not.  I can't tell.  If you are using Cygwin then you should
see if an update is available.  If not then you should make your
report directly to them.

Cygwin Home Page

  http://cygwin.com/

Cygwin FAQ

  http://cygwin.com/faq/

Cygwin Bug Report Guidelines

  http://cygwin.com/bugs.html

Bob


> Sample text file: file.txt
> --------------------
> Hello
> there
> -------------------
> 
> run:
> cat file.txt | egrep -e "o$"
> you will get nothing
> 
> run:
> egrep -e "o$" file.txt'
> you will get "Hello"
> 
> run:
> egrep -e "^" file.txt | egrep -e "o$"
> you get "Hello"
> 
> if you compare the result of runing:
> cat file.txt
> with:
> egrep -e "^"
> they look the same.
> 
> It seems 'cat' is chaning the output such that 'egrep' (grep -E) can't match 
> the end-of-line marker correctly. Interestingly enough if you dont include a 
> carrage return after the 'there' in the file then it seems to pick up 'cat 
> file.txt | egrep -e "e$"' just fine or if you try this: 'cat file.txt | egrep 
> -e "$"' it also seems to do what you would expect.
> 
> For the time being I have replaced cat.exe with a shell script as follows:
> ---------------------------
> #!/bin/sh
> 
> egrep -e "^" $1
> --------------------------
> 
> and that seems to be working for me. But this does seem like a bug.
> 
> Jim Carroll



reply via email to

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