From: Frank Terbeck Date: Thu, 27 Mar 2014 12:13:16 +0000 (+0100) Subject: Make ‘egrep’ use the same options as ‘grep’ [Closes: issue1230] X-Git-Tag: v0.9.5~7 X-Git-Url: https://git.grml.org/?a=commitdiff_plain;ds=sidebyside;h=5afe1a231d01ccbdfb747c397f760eb936004814;p=grml-etc-core.git Make ‘egrep’ use the same options as ‘grep’ [Closes: issue1230] --- diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index d032b3e..6cd9d24 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -2941,8 +2941,13 @@ modified() { check_com new || alias new=modified # use colors when GNU grep with color-support -#a2# Execute \kbd{grep -{}-color=auto} -(( $#grep_options > 0 )) && alias grep='grep '${grep_options:+"${grep_options[*]}"} +if (( $#grep_options > 0 )); then + o=${grep_options:+"${grep_options[*]}"} + #a2# Execute \kbd{grep -{}-color=auto} + alias grep='grep '$o + alias egrep='egrep '$o + unset o +fi # Translate DE<=>EN # 'translate' looks up fot a word in a file with language-to-language