bug-grep
[Top][All Lists]
Advanced

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

Re: [bug-grep] bashism in egrep


From: Han Boetes
Subject: Re: [bug-grep] bashism in egrep
Date: Thu, 24 Feb 2005 09:58:52 +0059
User-agent: Mutt/1.5.8i

Stepan Kasal wrote:
> On Sat, Feb 19, 2005 at 10:33:21AM -0700, Bob Proulx wrote:
> > Then zsh is not suitable as a /bin/sh replacement.
>
> IIRC, zsh has fixed this. Try to upgrade to the latest version
> of zsh, it might help.

That's the one I am running. It didn't help allas. Zsh is not yet
suitable to be a proper POSIX sh. But I think I found something
better: ash. Hard to find but I made a port for it:

  http://www.xs4all.nl/~hanb/software/crux/han/ash/Pkgfile


> > > exec grep -E "$@"
> >
> > That fails to handle empty arguments properly on many legacy
> > systems.
>
> To be more precise, this mishandles the case when no arguments
> are given, on those legacy systems.
>
> What does this mean in our case? You call "egrep" and instead
> of the usage message, you get ... nothing, egrep reads stdin
> and waits.
>
> I don't think this bug is that important; you almost never call
> "egrep" with no parameters from a script. And when you do it
> from cmdline, you can hit ^C after a while.
>
> I have already considered the possibility of replacing ${1+"$@"}
> with mere "$@", especially if "separate binaries" becomes the
> default method of installation, as proposed before.
>
> The reason is not the zsh bug, of course. I just don't like
> having workarounds in code, if they aren't absolutely necessary.
> (Someone could read the script and reproduce the pattern...)

IMHO the best thing is to link egrep to grep and let it be managed
internally.



# Han
-- 
    \    /    Oh, I don't blame Congress. If I had $600 billion at my
    )\__/(    disposal, I'd be irresponsible, too. -- Lichty & Wagner
    |(oO)|
     \||/
Ts   (OO)
+vVv------vVv----------------------------------------------------------+




reply via email to

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