Call for tests - BSD
Users browsing this thread: 1 Guest(s)
|
|||
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 |
|||
|
|||
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>" Code: echo "<action=xclock>$(date)</action>" | grep -v "<action=([^>]*)>([.+]?)</action>" |
|||
|
|||
None worked on Mac OS X.
|
|||
|
|||
The problem is BSD grep does not support two adjacent repetition operators "+?". Only GNU grep does.
|
|||
|
|||
Nothing happens with either one on my FreeBSD 9.1 setup.
|
|||
|
|||
> 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
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. |
|||
|
|||
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. |
|||
|
|||
That's what's expected, now dcoppa will have a fun time looking at commits on the FreeBSD svnweb :)
|
|||
|
|||
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! :) |
|||
|
|||
http://www.openbsd.org/cgi-bin/cvsweb/~c...Actions_hs
So plhk fixed my issue. I told you he's Da Man! |
|||