GNU bug report logs - #36820
grep "[[:cntrl:]]" /proc/1/cmdline works on 2.20 but not 3.3

Previous Next

Package: grep;

Reported by: Jeff Chua <jeff.chua.linux <at> gmail.com>

Date: Sat, 27 Jul 2019 00:15:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #22 received at 36820-done <at> debbugs.gnu.org (full text, mbox):

From: Ángel <angel <at> re.16bits.net>
To: 36820-done <at> debbugs.gnu.org
Cc: Daniele Grassini <danielegrassini <at> libero.it>
Subject: Re: bug#36960: mistake with v param
Date: Sat, 17 Aug 2019 00:28:13 +0200
On 2019-08-07 at 17:45 +0200, Daniele Grassini wrote:
> so why the '-o' option check the regular exp, but the '-v' don't do his 
> job??
> 

Hello Daniele


As the manual states:

> -v, --invert-match
>               Invert the sense of matching, to select non-matching lines.

With -v you are matching the *lines* that don't contain "[a-z]{1}[0-9]+\.ko$", not the *portion of the line* which doesn't match.

For removing lines which end that way I would recommend you to simply replace your grep with sed, ie.
   sed -E 's/[a-z]{1}[0-9]+\.ko$//'

(add -n and p flag to ignore lines not ending that way)

Best regards





This bug report was last modified 5 years and 274 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.