diff --git a/.bash_logout b/.bash_logout index 0ea1ecd..6c254ae 100644 --- a/.bash_logout +++ b/.bash_logout @@ -2,11 +2,11 @@ # Clear the screen/console on logout. if (( $SHLVL == 10 )); then - if [ -x /usr/bin/clear_console ]; then + if [[ -x /usr/bin/clear_console ]]; then /usr/bin/clear_console -q - elif [ -x /usr/bin/clear ]; then + elif [[ -x /usr/bin/clear ]]; then /usr/bin/clear - elif [ -x /usr/bin/tput ]; then + elif [[ -x /usr/bin/tput ]]; then /usr/bin/tput clear else echo -ne "\E[2J" diff --git a/.bash_profile b/.bash_profile index 0f76a53..00ba2d4 100644 --- a/.bash_profile +++ b/.bash_profile @@ -1,5 +1,5 @@ # Souce bash specific set up, -[ -f ~/.bashrc ] && . ~/.bashrc +[[ -f ~/.bashrc ]] && . ~/.bashrc # Environment. export EDITOR="nano" @@ -11,17 +11,17 @@ export MANPAGER="less -Mis -PM'Page %dt$'" export PAGER="less" export PATH="/usr/local/sbin:/usr/sbin:/opt/sbin:/sbin:$PATH" export VISUAL="$EDITOR" -[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" +[[ -x /usr/bin/lesspipe ]] && eval "$(SHELL=/bin/sh lesspipe)" # Platform specific set up. _PLATFORM="$(uname -s)" -if [ "$_PLATFORM" = "Linux" ]; then +if [[ "$_PLATFORM" = "Linux" ]]; then export I_WANT_A_BROKEN_PS=1 export LYNX_CFG="$HOME/.lynx.cfg" export LYNX_LSS="$HOME/.lynx.lss" - export MANPATH="~/.local/share/man:$MANPATH" + export MANPATH="$HOME/.local/share/man:$MANPATH" hash dircolors >/dev/null 2>&1 && eval "$(dircolors -b ~/.dir_colors)" -elif [ "$_PLATFORM" = "Darwin" ]; then +elif [[ "$_PLATFORM" = "Darwin" ]]; then export LSCOLORS="ExGxdxdxCxDxDxbcacbeae" export MANPATH="/opt/local/share/man:$MANPATH" export PATH="/opt/local/sbin:/opt/local/bin:$PATH" @@ -31,9 +31,9 @@ fi unset _PLATFORM # Add bin directories to PATH. -[ -d "$HOME/files/bin" ] && export PATH="$HOME/files/bin:$PATH" -[ -d "$HOME/.local/bin" ] && export PATH="$HOME/.local/bin:$PATH" -[ -d "$HOME/bin" ] && export PATH="$HOME/bin:$PATH" +[[ -d "$HOME/files/bin" ]] && export PATH="$HOME/files/bin:$PATH" +[[ -d "$HOME/.local/bin" ]] && export PATH="$HOME/.local/bin:$PATH" +[[ -d "$HOME/bin" ]] && export PATH="$HOME/bin:$PATH" # Make ssh-agent work better. hash ssh-add ssh-agent >/dev/null 2>&1 && { @@ -95,13 +95,13 @@ hash ssh-add ssh-agent >/dev/null 2>&1 && { # Screen. hash screen >/dev/null 2>&1 && { - if [ ! -e ~/.hushlogin ]; then - if [ ! -z "$STY" ]; then + if [[ ! -e ~/.hushlogin ]]; then + if [[ ! -z "$STY" ]]; then echo "Screen $STY, window $WINDOW." echo else _SCREENS="$( screen -ls | grep '[[:alpha:]]' | egrep -v '^([[:digit:]]+|No) Socket(s)?' )" - if [ -n "$_SCREENS" ]; then + if [[ -n "$_SCREENS" ]]; then echo "$_SCREENS" echo else @@ -114,9 +114,9 @@ hash screen >/dev/null 2>&1 && { } # Mail check. -[ ! -z "$SSH_CONNECTION" ] && { - if [ -s /var/spool/mail/$USER ]; then - if [ -N /var/spool/mail/$USER ]; then +[[ ! -z "$SSH_CONNECTION" ]] && { + if [[ -s /var/spool/mail/$USER ]]; then + if [[ -N /var/spool/mail/$USER ]]; then echo "You have new mail." echo else diff --git a/.bashrc b/.bashrc index 908000e..3e2aedc 100644 --- a/.bashrc +++ b/.bashrc @@ -155,7 +155,7 @@ PS4="+(\[\e[33m\]\\\$? = \$?\[$(tput sgr0)\]) \[$(tput bold)$(tput setaf 4)\]\${ # Platform specific set up. _PLATFORM="$(uname -s)" -if [ "$_PLATFORM" = "Linux" ]; then +if [[ "$_PLATFORM" = "Linux" ]]; then # Linux specific aliases. hash ftpwho >/dev/null 2>&1 && alias ftpwho='ftpwho -v' hash iftop >/dev/null 2>&1 && alias iftop='TERM=vt100 iftop' @@ -171,7 +171,7 @@ if [ "$_PLATFORM" = "Linux" ]; then psgrep() { ps -auwwx | egrep "(RSS|$1)" } -elif [ "$_PLATFORM" = "Darwin" ]; then +elif [[ "$_PLATFORM" = "Darwin" ]]; then # Darwin specific aliases. hash df >/dev/null 2>&1 && alias df='df -P' hash ls >/dev/null 2>&1 && alias ls='ls -bFG'