comparison rc/bashrc @ 628:7bcc81f6b210

Correct os version check
author nanaya <me@nanaya.pro>
date Sun, 30 Jun 2019 20:31:45 +0900
parents 84791ac85abd
children d36b8abe71ec
comparison
equal deleted inserted replaced
627:84791ac85abd 628:7bcc81f6b210
28 28
29 # Basic PATH 29 # Basic PATH
30 export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/games" 30 export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/games"
31 31
32 _os="$(uname -s)" 32 _os="$(uname -s)"
33 _os_r="$(uname -r)"
33 34
34 # pkgsrc 35 # pkgsrc
35 if test -d /usr/pkg; then 36 if test -d /usr/pkg; then
36 PATH="${PATH}:/usr/pkg/bin:/usr/pkg/sbin" 37 PATH="${PATH}:/usr/pkg/bin:/usr/pkg/sbin"
37 if test -d /usr/pkg/java/openjdk7; then 38 if test -d /usr/pkg/java/openjdk7; then
285 alias 0pp="gzip | curl 'https://0paste.com/pastes.txt' -F 'paste[is_private]=1' -F 'paste[paste_gzip]=<-'" 286 alias 0pp="gzip | curl 'https://0paste.com/pastes.txt' -F 'paste[is_private]=1' -F 'paste[paste_gzip]=<-'"
286 fi 287 fi
287 288
288 if command -v tmux > /dev/null 2>&1; then 289 if command -v tmux > /dev/null 2>&1; then
289 case "${_os}" in 290 case "${_os}" in
290 "OpenBSD "*" "6.[5-9]" "*|"OpenBSD "*" "[7-9].[0-9]" "*|"OpenBSD "*" "[1-9][0-9][0-9]*.[0-9]" "*)
291 _tmux_conf_ver=2.9
292 ;;
293 OpenBSD) 291 OpenBSD)
294 # probably not accurate enough but I don't want to dig through all the previous versions. 292 case "${_os_r}" in
295 _tmux_conf_ver=2.2 293 6.[5-9]|[7-9].[0-9]|[1-9][0-9][0-9]*.[0-9])
294 _tmux_conf_ver=2.9
295 ;;
296 *)
297 # probably not accurate enough but I don't want to dig through all the previous versions.
298 _tmux_conf_ver=2.2
299 ;;
300 esac
296 ;; 301 ;;
297 *) 302 *)
298 case "$(tmux -V 2> /dev/null)" in 303 case "$(tmux -V 2> /dev/null)" in
299 "tmux 2."[9][a-z]*|"tmux "[3-9]"."[0-9]|"tmux "[1-9][0-9][0.9]*"."[0-9]) _tmux_conf_ver=2.9;; 304 "tmux 2."[9][a-z]*|"tmux "[3-9]"."[0-9]|"tmux "[1-9][0-9][0.9]*"."[0-9]) _tmux_conf_ver=2.9;;
300 "tmux 2."[2-8]) _tmux_conf_ver=2.2;; 305 "tmux 2."[2-8]) _tmux_conf_ver=2.2;;
307 alias tmux="tmux -f '""${HOME}""/.tmux-""${_tmux_conf_ver}"".conf'" 312 alias tmux="tmux -f '""${HOME}""/.tmux-""${_tmux_conf_ver}"".conf'"
308 unset _tmux_conf_ver 313 unset _tmux_conf_ver
309 fi 314 fi
310 315
311 unset _os 316 unset _os
317 unset _os_r
312 318
313 [ -f "${HOME}/.ec.bash.after" ] && . "${HOME}/.ec.bash.after" 319 [ -f "${HOME}/.ec.bash.after" ] && . "${HOME}/.ec.bash.after"