[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: any chance to workaround again "buggy" grep -e on SVR4?

From: Paul Eggert
Subject: Re: any chance to workaround again "buggy" grep -e on SVR4?
Date: Sat, 20 Oct 2012 23:20:28 -0700
User-agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121011 Thunderbird/16.0.1

On 10/19/2012 07:07 AM, Petr Sumbera wrote:

> Can we have it back again? See attached diff.

That diff doeesn't look right, as egrep's patterns are interpreted
differently from grep's.

Is there some reason that Oracle has never added the -e option to grep?
Could you please file a bug report for that?  It's been many years now
that -e has been in the POSIX standard, and there's no compatibility reason
why /usr/bin/grep -e should fail to work.

Anyway, I pushed the following workaround.  It assumes that you have
a more standard 'grep' floating around somewhere, which is pretty much
true on Solaris these days.

>From 0e5c03642a0dce9b099e114655a899051ce73f86 Mon Sep 17 00:00:00 2001
From: Paul Eggert <address@hidden>
Date: Sat, 20 Oct 2012 23:15:26 -0700
Subject: [PATCH] zgrep: do not assume standard 'grep' has -e

On Solaris 11, /usr/bin/grep -e does not work.
Problem reported by Petr Sumbera in
* Makefile.am (.in): Substitute @address@hidden
* configure.ac (AC_PROG_GREP): Invoke.
* zgrep.in (grep): Use @address@hidden
 Makefile.am  | 1 +
 configure.ac | 1 +
 zgrep.in     | 2 +-
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 86a0297..90fff2d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -84,6 +84,7 @@ SUFFIXES = .in
        $(AM_V_GEN)sed \
                -e 's|/bin/sh|$(SHELL)|g' \
                -e 's|address@hidden@|'\''$(bindir)'\''|g' \
+               -e 's|address@hidden@|$(GREP)|g' \
                -e 's|address@hidden@|$(VERSION)|g' \
                $(srcdir)/address@hidden >address@hidden \
          && chmod a+x address@hidden \
diff --git a/configure.ac b/configure.ac
index 4705ce4..ecb362b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,6 +33,7 @@ AM_SILENT_RULES([yes]) # make --enable-silent-rules the 
 AC_CHECK_TOOL([NM], [nm], [nm])
diff --git a/zgrep.in b/zgrep.in
index f878acf..aec4a67 100644
--- a/zgrep.in
+++ b/zgrep.in
@@ -28,7 +28,7 @@ case $1 in
 version='zgrep (gzip) @VERSION@
 Copyright (C) 2010-2012 Free Software Foundation, Inc.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]