delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/07/02/10:32:05

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-Id: <5.1.0.14.2.20010702072711.022d3a48@pop3.cris.com>
X-Sender: rrschulz AT pop3 DOT cris DOT com
X-Mailer: QUALCOMM Windows Eudora Version 5.1
Date: Mon, 02 Jul 2001 07:31:32 -0700
To: russell christian sears <sears AT cis DOT ohio-state DOT edu>, <cygwin AT cygwin DOT com>
From: Randall R Schulz <rrschulz AT cris DOT com>
Subject: Re: 1.3.2, 1.1.8: Pipelines losing data? (Windows 2000)
In-Reply-To: <Pine.GSO.4.33.0107020920330.29369-100000@beta.cis.ohio-sta
te.edu>
Mime-Version: 1.0

Russell,

Depending on the terminal you're using, which termcap / terminfo entry 
you've specified and the terminal window's size, less will produce 
different literal output sequences as it paginates and line-wraps its 
input. (Although I would have thought that if the output was not a tty, it 
would forgo such manipulations and act just like cat.)

You really shouldn't use a program explicitly designed for visual display 
on a terminal to feed a pipe to grep or any other processor.

Just grep the target file.

Randall Schulz
Mountain View, CA USA


At 06:21 2001-07-02, russell christian sears wrote:
>I have found a problem using less and grep to search a file.  The file is 
>available at: http://www.cis.ohio-state.edu/~sears/file.txt (It is over 1 
>megabyte, so I did not include it in this message.)
>
>I am using bash, and a complete, current installation of cygwin.
>
>When I run the command `less file.txt | grep cygwin` it sometimes fails to 
>find a match in the file, even though the file does contain the string.
>
>It seems to be sporadic, but I have been able to reproduce the problem on 
>three machines, each of which ran at about 700mhz.  Other commands that 
>seem to work as expected follow:
>
>less file.txt | cat | grep cygwin
>cat file.txt | grep cygwin
>grep cygwin file.txt
>
>If you have difficulty reproducing the bug, try running the command 
>multiple times (eg: by repeating <up-arrow>, <enter> rapidly).  Some 
>installations will only rarely have a problem, others will rarely yield 
>the correct result.  On systems that usually produce the correct result, 
>re-running the command rapidly seems to increase the likelihood of the 
>problem ocurring.
>
>Also, the string "cygwin" always appears at the end of a line in the file, 
>which may be related to this bug.
>
>I have tried both version 1.1.8 and the current cygwin distribution. 
>(1.3.2)  Both seem to suffer from this problem.
>
>As a control, I've checked this against a Linux system, and the bug did 
>not exist there.
>
>Below, the mount mode is listed as textmode.  The bug exists under binmode 
>as well.
>
>...


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019