comparison rc/bashrc @ 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
comparison
equal deleted inserted replaced
695:26568ef0d05a 696:3588f4f96c31
130 [ -d "/opt/csw/gnu" ] && PATH="/opt/csw/gnu:${PATH}" 130 [ -d "/opt/csw/gnu" ] && PATH="/opt/csw/gnu:${PATH}"
131 [ -d "/opt/local/sbin" ] && PATH="/opt/local/sbin:${PATH}" 131 [ -d "/opt/local/sbin" ] && PATH="/opt/local/sbin:${PATH}"
132 [ -d "/opt/local/bin" ] && PATH="/opt/local/bin:${PATH}" 132 [ -d "/opt/local/bin" ] && PATH="/opt/local/bin:${PATH}"
133 alias ping="ping -s" 133 alias ping="ping -s"
134 alias ping6="ping -A inet6" 134 alias ping6="ping -A inet6"
135 if command -v ggrep > /dev/null 2>&1; then
136 _has_gnu_grep=y
137 _grep="ggrep"
138 fi
139 if command -v gls > /dev/null 2>&1; then 135 if command -v gls > /dev/null 2>&1; then
140 _has_gnu_ls=y 136 _has_gnu_ls=y
141 _ls="gls" 137 _ls="gls"
142 fi 138 fi
143 ;; 139 ;;
151 if command -v gls > /dev/null 2>&1; then 147 if command -v gls > /dev/null 2>&1; then
152 _has_gnu_ls=y 148 _has_gnu_ls=y
153 _ls="gls" 149 _ls="gls"
154 elif command -v colorls > /dev/null 2>&1; then 150 elif command -v colorls > /dev/null 2>&1; then
155 alias ls="colorls -F" 151 alias ls="colorls -F"
156 fi
157 if command -v ggrep > /dev/null 2>&1; then
158 _has_gnu_grep=y
159 _grep="ggrep"
160 fi 152 fi
161 ;; 153 ;;
162 NetBSD|DragonFly) 154 NetBSD|DragonFly)
163 if command -v gls > /dev/null 2>&1; then 155 if command -v gls > /dev/null 2>&1; then
164 _has_gnu_ls=y 156 _has_gnu_ls=y
174 MSYS_NT-*) 166 MSYS_NT-*)
175 _has_gnu_ls=y 167 _has_gnu_ls=y
176 export PATH="${PATH}:${_org_path}" 168 export PATH="${PATH}:${_org_path}"
177 ;; 169 ;;
178 esac 170 esac
171
172 if command -v ggrep > /dev/null 2>&1; then
173 _has_gnu_grep=y
174 _grep="ggrep"
175 fi
179 176
180 if [ "${_has_gnu_ls}" = y ]; then 177 if [ "${_has_gnu_ls}" = y ]; then
181 _root_opt="" 178 _root_opt=""
182 if [ "${_uid}" = "0" ]; then 179 if [ "${_uid}" = "0" ]; then
183 _root_opt=" -A" 180 _root_opt=" -A"