Call for tests - BSD

Users browsing this thread: 8 Guest(s)
dcoppa
Members
I'm fighting with gnuisms for a port I'm working on...

Could you please test the following commands:

http://paste.unixhub.net/index.php/pE3s/

I'm very interested in test reports from both FreeBSD and OSX.

TIA,
David
venam
Administrators
I'm running Linux but I can say that the regex looks right.
The first set of parenthesis only match one char, shouldn't it be like that, with the kleene start inside the parenthesis:
Code:
echo "<action=xclock>$(date)</action>" | grep -v "<action=([^>]*)>(.+ ?)</action>"
Also, can't you match the second back-reference with square-brackets?
Code:
echo "<action=xclock>$(date)</action>" | grep -v "<action=([^>]*)>([.+]?)</action>"
yrmt
Grey Hair Nixers
None worked on Mac OS X.
dcoppa
Members
The problem is BSD grep does not support two adjacent repetition operators "+?". Only GNU grep does.
zygotb
Long time nixers
Nothing happens with either one on my FreeBSD 9.1 setup.
dcoppa
Members
> Nothing happens with either one on my FreeBSD 9.1 setup.

No output means the regex works.
So FreeBSD fixed/expanded BSD regex(3), it seems...
yrmt
Grey Hair Nixers
(11-07-2013, 04:33 PM)dcoppa Wrote: > Nothing happens with either one on my FreeBSD 9.1 setup.

No output means the regex works.
So FreeBSD fixed/expanded BSD regex(3), it seems...

Oh well then both worked on osx
dcoppa
Members
> Oh well then both worked on osx

Well, I kind of expected it since osx uses freebsd code for standard unix utilities...

So I just need to find what commit from FreeBSD I'd need to port to OpenBSD.
berk
Long time nixers
FreeBSD 9.1-RELEASE-p4 i386
egrep (GNU grep) 2.5.1-FreeBSD

Both commands exit with status code 1 and no output to stdout.
yrmt
Grey Hair Nixers
That's what's expected, now dcoppa will have a fun time looking at commits on the FreeBSD svnweb :)
dcoppa
Members
Ah-ah!

From https://wiki.freebsd.org/BSDgrep:

"BSD grep has been imported to 9.0-CURRENT on July 22, 2010. It has been obtained from the OpenBSD and the FreeGrep projects to make it appropriate for our needs to provide GNU compatibility and let ports build without problems. GNU compatibility is almost 100%, the only missing feature is -P (--perl-regex), which is not possible to support without having PCRE in base system and anyway, it was disabled in GNU grep for the same reason. It is still linked to GNU libregex because we needed compatibility for non-standard regexes, e.g. [foo|] is accepted by GNU, while it is considered an empty subexpression in stricter implementations."

FreeBSD links with GNU libregex. Traitors! :)
dcoppa
Members
http://www.openbsd.org/cgi-bin/cvsweb/~c...Actions_hs

So plhk fixed my issue.

I told you he's Da Man!