Hi Jeff,
> Recursive diff succeeds without trying?> busybox diff -rq /bin /etc> echo $?
Actually, it does what it's supposed to do with BusyBox 1.21.1 on Alpine
2.7.9.
| $ diff -rq /bin /etc||
|| Only in /etc: TZ||
|| Only in /bin: addgroup||
|| Only in /bin: adduser||
|| Only in /etc: adjtime||
|| Only in /etc: alpine-release||
|| Only in /bin: ash||
|| [...]||
|| $ echo $?||
|| 1||
|
> This should be a match?> echo "abbc" | busybox grep 'ab\+c'
A very peculiar behaviour, indeed. Though, syntax and match are correct,
because:
"In basic regular expressions the metacharacters ?, +, {, |, (, and )
lose their special meaning; instead use the backslashed versions \?,
\+, \{, \|, \(, and \)."
For more information see: http://unixhelp.ed.ac.uk/CGI/man-cgi?grep
I've verified the behaviour with GNU grep 2.18, as well. Your example is
equivalent to:
| echo "abbc" | grep 'abb*c'||
|
HIH, Tiger
>>> Recursive diff succeeds without trying?>>> busybox diff -rq /bin /etc>>> echo $?>> Actually, it does what it's supposed to do with BusyBox 1.21.1 on>> Alpine 2.7.9.> Not sure about this... but.
The given example works with BusyBox 1.22.1 on 3.0.1 just as well.
> Alpine 3.0+ use musl implementation of regular expressions in busybox.
There we go: grep 'ab\+c' certainly fails on 3.0, while grep 'abb*c' is
POSIX and therefore working fine.
Tiger
---
Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org
Help: alpine-devel+help@lists.alpinelinux.org
---
On Fri, 22 Aug 2014 17:21:20 +0200
Der Tiger <der.tiger.alpine@arcor.de> wrote:
> Hi Jeff,> > Recursive diff succeeds without trying?> > busybox diff -rq /bin /etc> > echo $?> Actually, it does what it's supposed to do with BusyBox 1.21.1 on> Alpine 2.7.9.> > | $ diff -rq /bin /etc||> || Only in /etc: TZ||> || Only in /bin: addgroup||> || Only in /bin: adduser||> || Only in /etc: adjtime||> || Only in /etc: alpine-release||> || Only in /bin: ash||> || [...]||> || $ echo $?||> || 1||
Not sure about this... but.
> > This should be a match?> > echo "abbc" | busybox grep 'ab\+c'> A very peculiar behaviour, indeed. Though, syntax and match are> correct, because:> > "In basic regular expressions the metacharacters ?, +, {, |, (,> and ) lose their special meaning; instead use the backslashed> versions \?, \+, \{, \|, \(, and \)."> > > For more information see: http://unixhelp.ed.ac.uk/CGI/man-cgi?grep> > I've verified the behaviour with GNU grep 2.18, as well. Your example> is equivalent to:> > | echo "abbc" | grep 'abb*c'||> |
Alpine 3.0+ use musl implementation of regular expressions in busybox.
musl is strictly POSIX confirming, and \+ in BRE is not POSIX
specified. Some implementations support it, notable GNU. But that is
implementation specific extension and not portable or standard
compliant.
The posix compliant way is:
$ echo "abbc" | busybox grep "ab\{1,\}c"
abbc
See, eg. http://www.regular-expressions.info/posix.html
/Timo
---
Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org
Help: alpine-devel+help@lists.alpinelinux.org
---
On Sat, 23 Aug 2014 00:18:02 +0200
Der Tiger <der.tiger.alpine@arcor.de> wrote:
> > >>> Recursive diff succeeds without trying?> >>> busybox diff -rq /bin /etc> >>> echo $?> >> Actually, it does what it's supposed to do with BusyBox 1.21.1 on> >> Alpine 2.7.9.> > Not sure about this... but.> The given example works with BusyBox 1.22.1 on 3.0.1 just as well.
Yes. And is broken in edge. Seems stat() returns different stuff. Not
sure if it's kernel, musl or busybox bug, but it is a bug.
- Timo
---
Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org
Help: alpine-devel+help@lists.alpinelinux.org
---