diff rc/bashrc @ 697:7359a8dbab5c

[bashrc] Simplify grep check and unify ls check
author nanaya <me@nanaya.pro>
date Sun, 23 Oct 2022 02:04:26 +0900
parents 3588f4f96c31
children 8c2ba562b15a
line wrap: on
line diff
--- a/rc/bashrc	Sun Oct 23 02:01:05 2022 +0900
+++ b/rc/bashrc	Sun Oct 23 02:04:26 2022 +0900
@@ -132,33 +132,16 @@
     [ -d "/opt/local/bin" ] && PATH="/opt/local/bin:${PATH}"
     alias ping="ping -s"
     alias ping6="ping -A inet6"
-    if command -v gls > /dev/null 2>&1; then
-      _has_gnu_ls=y
-      _ls="gls"
-    fi
   ;;
   FreeBSD)
     # Multi CPU awesomeness.
     alias top="top -P"
-    # FreeBSD grep isn't GNU grep but supports all of its commands
+    # The grep isn't GNU grep but supports all of its commands
     _has_gnu_grep=y
   ;;
-  OpenBSD)
-    if command -v gls > /dev/null 2>&1; then
-      _has_gnu_ls=y
-      _ls="gls"
-    elif command -v colorls > /dev/null 2>&1; then
-      alias ls="colorls -F"
-    fi
-  ;;
   NetBSD|DragonFly)
-    if command -v gls > /dev/null 2>&1; then
-      _has_gnu_ls=y
-      _ls="gls"
-    elif command -v colorls > /dev/null 2>&1; then
-      alias ls="colorls -F"
-    fi
-    alias grep='grep --color=auto'
+    # The grep isn't GNU grep but supports all of its commands
+    _has_gnu_grep=y
   ;;
   CYGWIN*)
     export PATH="${PATH}:${_org_path}"
@@ -169,6 +152,13 @@
   ;;
 esac
 
+if command -v gls > /dev/null 2>&1; then
+  _has_gnu_ls=y
+  _ls="gls"
+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"