GNU bug report logs - #20883
egrep on Solaris fails to call original grep binary

Previous Next

Package: grep;

Reported by: Vladimir Marek <Vladimir.Marek <at> oracle.com>

Date: Tue, 23 Jun 2015 15:40:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Vladimir Marek <Vladimir.Marek <at> oracle.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 20883 <at> debbugs.gnu.org
Subject: bug#20883: egrep on Solaris fails to call original grep binary
Date: Fri, 26 Jun 2015 17:09:34 +0200
> >$ PATH=/usr/bin gegrep
> >grep: illegal option -- E
> 
> On recently-patched Solaris 10 with bleeding-edge GNU grep, I see the
> following instead:
> 
>   $ PATH=/usr/bin gegrep
>   gegrep: not found
> 
> The above behavior is with /bin/sh, and with gegrep installed in some
> directory that is in my ordinary PATH but not in /usr/bin.
> 
> >The gegrep script:
> >
> >#!/bin/bash
> >grep=grep
> >case $0 in
> >  */*)
> >    dir=${0%/*}
> >    if test -x "$dir/grep"; then
> >      PATH=$dir:$PATH
> >      grep=grep
> >    fi;;
> >esac
> >exec $grep -E "$@"
> 
> Assuming you configure this way:
> 
>   ./configure --prefix=/my/dir --program-prefix=g
> 
> (which is how I did it), the egrep script in bleeding-edge grep (obtained
> from savannah via git) should be much simpler:
> 
>   #!/bin/bash
>   exec ggrep -E "$@"


That's a nice simplification of the previous state :)


> and this may fix your problem (though I admit I don't understand your
> problem).  The egrep script was simplified as part of the fix for Bug#19998;
> see:
> 
> http://bugs.gnu.org/19998#37
> 
> By the way, probably you know this already, but portable scripts should not
> use egrep or fgrep, as these two commands have been removed from POSIX.
> They should use 'grep -E' and 'grep -F' instead.

Thank you for the pointer, it helps. Also sorry for the not-so-clear
report, after thinking about it twice, the problem in Solaris is that we
provide both variants. With 'g' prepended and without. So I have to make
the script a little bit more difficult.


Thanks for your time looking at this and your help

-- 
	Vlad




This bug report was last modified 9 years and 334 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.