# HG changeset patch # User nanaya # Date 1666458065 -32400 # Node ID 3588f4f96c319c2818a710057e52835d11a2220e # Parent 26568ef0d05ae07077c9a269cb7e28b30bd79433 [bashrc] Add global gnu grep check diff -r 26568ef0d05a -r 3588f4f96c31 rc/bashrc --- 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