[sr #110657] Autoconf configure script considers absence of usable grep a fatal error, although it only uses egrep thereafter

Alain Knaff <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.bugs
Message-ID <[email protected]>
Follow-up Comment #8, sr #110657 (project autoconf):

[comment #6 comment #6:]
> How about the attached patch instead?

Unfortunately, this patch doesn't work ... due to another peculiarity of
UnixPC's egrep which had escaped earlier: for some weird reason, if -e is
used, egrep doesn't support grepping in stdin, but only in files given on
command line.

i.e. egrep -e root </etc/passwd doesn't work.

However, egrep -e root /etc/passwd does work, and so does egrep root
</etc/passwd

There seems no easy fix for it, because the use case (grepping in cpp's
output) does indeed involve grepping from stdin. Catching cpp's output into a
file would be needlessly cumbersome, so we might need to ponder whether -e is
indeed needed for AC_EGREP_CPP. I think we do agree that multiple -e options
are not needed for AC_EGREP_CPP. So the only reason why -e is needed is to
search for strings that start with a dash. But there is another way than -e to
escape that dash: simply put a pair of parenthesis around the search string:

egrep '(-z)' </etc/profile


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/support/?110657>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.