Hi, this is a negative lookbehind assertion - quoting from perlre(1):
"(?<!pattern)" A zero-width negative lookbehind assertion. For example "/(?<!bar)foo/" matches any occurrence of "foo" that does not follow "bar". Works only for fixed-width lookbehind. So it should match 'error' (if it does not follow 'no ') and it should match 'warning', 'fail' and 'failed' (if it does not follow 'insserv: '). HTH, Thomas Patrick Matthäi <pmatth...@debian.org> writes: > Am 30.10.2016 um 12:31 schrieb Stephan Sürken: >> Hi Evgeni, Patrick, >> >> fwiw (probably this is already worked on), i have fixed up my system by >> >> * reverting 01-grep-syntax-error.diff >> >> This actually totally breaks things, as this now uses "P" as pattern, >> practically matching always: >> >> -- >> grep -aiqseP "$AD_HIST_ERRPATTERN" "$AD_HIST_PATH/typescript" >> -- >> >> I would actually like to see call grep (in the cmd script) called like so >> >> -- >> grep -a -q -i -s -P -e "$AD_HIST_ERRPATTERN" "$AD_HIST_PATH/typescript" >> -- >> >> (however, '-aiqsPe' should work as well). >> >> * Use custom err-pattern >> >> I don't really know what's wrong with the default perl regex (should >> the '<' stuff be actually be in the final string?), I am just using >> a simpler one now that works. On a shell you can see the error via >> >> -- >> grep -P -e '((?<!no )error|(?<!insserv: )warning|fail(ed)?)' >> -- >> >> (That's the same string you also see in the "meta" debug file, using >> all defaults for err-pattern). >> >> So for me it seems: >> >> * With the default pattern in place (and pre-patch), the grep would >> always fail, meaning it would never detect an actual error in >> typescript. >> * With the broken patch, it always wrongly finds errors (while showing >> an empty log via less). >> >> So please remove 01-grep-syntax-error.diff, and somehow fix the default >> pattern ;). >> >> Hth! >> >> S > I already noticed, that my patch always matches and removed it in my > vcs. On my cmd it worked.. > Anyway with "grep -a -q -i -s -P -e" and "grep -P -e '((?<!no > )error|(?<!insserv: )warning|fail(ed)?)'" I get again a syntax error > on jessie. Maybe Thomas could say us, what he wanted to match and how we > should fix it now. > > -- > /* > Mit freundlichem Gruß / With kind regards, > Patrick Matthäi > GNU/Linux Debian Developer > > Blog: http://www.linux-dev.org/ > E-Mail: pmatth...@debian.org > patr...@linux-dev.org > */ > -- :: WWW: https://fiasko-nw.net/~thomas/ :: ::: Jabber: xmpp:tho...@jabber.fiasko-nw.net ::: :: flickr: https://www.flickr.com/photos/laugufe/ ::