delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/03/04/08:57:18

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Message-ID: <49AE88A8.4030305@lysator.liu.se>
Date: Wed, 04 Mar 2009 14:56:56 +0100
From: Peter Rosin <peda AT lysator DOT liu DOT se>
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: grep -P regexp problem
References: <BAY127-DS374577AD66B9A49AF63E9A6A60 AT phx DOT gbl>
In-Reply-To: <BAY127-DS374577AD66B9A49AF63E9A6A60@phx.gbl>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Den 2009-03-03 19:26 skrev Andriy Sen:
> 
> Below is an example of the problem.
> 
> G:\>grep -V
> GNU grep 2.5.3
> 
> Copyright (C) 1988, 1992-2002, 2004, 2005  Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> 
> G:\>cat test.s
> a
> 1
> 
> G:\>cat test.s | grep -P "[^0]1"
> a
> 1
> 
> G:\>

FYI, appears to not be cygwin specific...

$ uname -s -r
Linux 2.6.23-gentoo-r8
$ grep -V
grep (GNU grep) 2.5.1

Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ cat test.s
a
1
$ cat test.s | grep -P "[^0]1"
a
1
$ od -a test.s
0000000   a  nl   1  nl
0000004

Cheers,
Peter

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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