Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: egrep with zsh as /bin/sh - wordsplitting



On Thu, Jan 13, 2005 at 09:50:18PM +0100, Michael Prokop wrote:
> 
> I'm maintainer of a Linux Live-CD with zsh as it's default shell.
> /bin/sh is pointing to /bin/zsh.
> 
> I've a problem with the scripts egrep and fgrep.
> That's the original egrep-script:
> 
> ,---- [ /bin/egrep - original version ]
> | #!/bin/sh
> | exec grep -E ${1+"$@"}
> `----
[...]

That's a known issue, and the generally provided work-around is:

test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}="$@"'

See info -f autoconf -n 'Shell Substitutions'

That should be

#!/bin/sh -

BTW.

-- 
Stéphane



Messages sorted by: Reverse Date, Date, Thread, Author