Browse Source

Convert [] to ksh style [[]] tests.

Based on a diff from Anthony Coulter.
OK krw, halex
OPENBSD_6_1
rpe 7 years ago
parent
commit
0ba52eeb8e
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      src/etc/ksh.kshrc

+ 5
- 5
src/etc/ksh.kshrc View File

@ -1,5 +1,5 @@
: :
# $OpenBSD: ksh.kshrc,v 1.21 2016/09/09 16:11:12 rpe Exp $
# $OpenBSD: ksh.kshrc,v 1.22 2016/09/09 16:25:37 rpe Exp $
# #
# NAME: # NAME:
# ksh.kshrc - global initialization for ksh # ksh.kshrc - global initialization for ksh
@ -65,7 +65,7 @@ case "$-" in
case "$TERM" in case "$TERM" in
sun*-s) sun*-s)
# sun console with status line # sun console with status line
if [ "$tty" != "$console" ]; then
if [[ $tty != $console ]]; then
# ilabel # ilabel
ILS='\033]L'; ILE='\033\\' ILS='\033]L'; ILE='\033\\'
# window title bar # window title bar
@ -84,7 +84,7 @@ case "$-" in
*) ;; *) ;;
esac esac
# do we want window decorations? # do we want window decorations?
if [ "$ILS" ]; then
if [[ -n $ILS ]]; then
function ilabel { print -n "${ILS}$*${ILE}">/dev/tty; } function ilabel { print -n "${ILS}$*${ILE}">/dev/tty; }
function label { print -n "${WLS}$*${WLE}">/dev/tty; } function label { print -n "${WLS}$*${WLE}">/dev/tty; }
@ -139,11 +139,11 @@ function no_path {
} }
# if $1 exists and is not in path, append it # if $1 exists and is not in path, append it
function add_path { function add_path {
[ -d ${1:-.} ] && no_path $* && eval ${2:-PATH}="\$${2:-PATH}:$1"
[[ -d ${1:-.} ]] && no_path $* && eval ${2:-PATH}="\$${2:-PATH}:$1"
} }
# if $1 exists and is not in path, prepend it # if $1 exists and is not in path, prepend it
function pre_path { function pre_path {
[ -d ${1:-.} ] && no_path $* && eval ${2:-PATH}="$1:\$${2:-PATH}"
[[ -d ${1:-.} ]] && no_path $* && eval ${2:-PATH}="$1:\$${2:-PATH}"
} }
# if $1 is in path, remove it # if $1 is in path, remove it
function del_path { function del_path {


Loading…
Cancel
Save