Mail archive
alpine-devel

[alpine-devel] Re: Busybox diff / grep oddities

From: Der Tiger <der.tiger.alpine_at_arcor.de>
Date: Fri, 22 Aug 2014 17:21:20 +0200

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



---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Fri Aug 22 2014 - 17:21:20 UTC