changeset 696:3588f4f96c31

[bashrc] Add global gnu grep check
author nanaya <me@nanaya.pro>
date Sun, 23 Oct 2022 02:01:05 +0900
parents 26568ef0d05a
children 7359a8dbab5c
files rc/bashrc
diffstat 1 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/rc/bashrc	Sun Oct 23 01:58:46 2022 +0900
+++ b/rc/bashrc	Sun Oct 23 02:01:05 2022 +0900
@@ -132,10 +132,6 @@
     [ -d "/opt/local/bin" ] && PATH="/opt/local/bin:${PATH}"
     alias ping="ping -s"
     alias ping6="ping -A inet6"
-    if command -v ggrep > /dev/null 2>&1; then
-      _has_gnu_grep=y
-      _grep="ggrep"
-    fi
     if command -v gls > /dev/null 2>&1; then
       _has_gnu_ls=y
       _ls="gls"
@@ -154,10 +150,6 @@
     elif command -v colorls > /dev/null 2>&1; then
       alias ls="colorls -F"
     fi
-    if command -v ggrep > /dev/null 2>&1; then
-      _has_gnu_grep=y
-      _grep="ggrep"
-    fi
   ;;
   NetBSD|DragonFly)
     if command -v gls > /dev/null 2>&1; then
@@ -177,6 +169,11 @@
   ;;
 esac
 
+if command -v ggrep > /dev/null 2>&1; then
+  _has_gnu_grep=y
+  _grep="ggrep"
+fi
+
 if [ "${_has_gnu_ls}" = y ]; then
   _root_opt=""
   if [ "${_uid}" = "0" ]; then