[Top][All Lists]

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

bug#36820: bug#36960: mistake with v param

From: Ángel
Subject: bug#36820: 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

reply via email to

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