# HG changeset patch # User nanaya # Date 1666458266 -32400 # Node ID 7359a8dbab5cc74f762335026aeb371526b91fd1 # Parent 3588f4f96c319c2818a710057e52835d11a2220e [bashrc] Simplify grep check and unify ls check diff -r 3588f4f96c31 -r 7359a8dbab5c rc/bashrc --- 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"