From 65cde185bb5ad9f1e2bcac355fe084805b649844 Mon Sep 17 00:00:00 2001 From: Alex Poslavsky Date: Tue, 17 May 2016 15:28:18 +0300 Subject: [PATCH] openbsd grep fix - use ggrep or use no color --- modules/utility/init.zsh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index a89047a..9ace33b 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -48,7 +48,13 @@ fi export GREP_COLOR='37;45' #BSD export GREP_COLORS="mt=${GREP_COLOR}" #GNU -alias grep='grep --color=auto' +if [[ $OSTYPE == openbsd* ]]; then + if (( ${+commands[ggrep]} )); then + alias grep='ggrep --color=auto' + fi +else + alias grep='grep --color=auto' +fi #