Changes between Version 1 and Version 2 of bash-shell-startup-files


Ignore:
Timestamp:
02/05/2019 02:19:09 PM (3 years ago)
Author:
DJ Lucas
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • bash-shell-startup-files

    v1 v2  
     1== Additions to stock files ==
     2
     3=== Remote user prompt ===
     4{{{
     5# Setup different prompt colors for local/remote and root/non-root users
     6NORMAL="\[\e[0m\]"
     7RED="\[\e[1;31m\]"
     8GREEN="\[\e[1;32m\]"
     9YELLOW="\[\e[1;33m\]"
     10MAGENTA="\[\e[1;35m\]"
     11CYAN="\[\e[1;36m\]"
     12
     13# Set local prompt color
     14if [[ $EUID == 0 ]] ; then
     15  if [[ $TERM == "screen" ]] ; then
     16    PS1="$RED\u [ $NORMAL\w$RED ] (screen)# $NORMAL"
     17  else
     18    PS1="$RED\u [ $NORMAL\w$RED ]# $NORMAL"
     19  fi
     20else
     21  if [[ $TERM == "screem" ]] ; then
     22    PS1="$YELLOW\w [ $NORMAL\w$YELLOW] (screen)\$ $NORMAL"
     23  else
     24    PS1="$GREEN\u [ $NORMAL\w$GREEN ]\$ $NORMAL"
     25  fi
     26fi
     27
     28# Set remote prompt
     29if [[ "$SSH_CLIENT" != "" ]] ; then
     30  if [[ $EUID == 0 ]] ; then
     31    if [[ $TERM == "screen" ]] ; then
     32      PS1="$MAGENTA\u@\h [ $NORMAL\w$MAGENTA ] (screen)# $NORMAL"
     33    else
     34      PS1="$MAGENTA\u@\h [ $NORMAL\w$MAGENTA ]# $NORMAL"
     35    fi
     36  else
     37    if [[ $TERM == "screen" ]] ; then
     38      PS1="$CYAN\u@\h [ $NORMAL\w$CYAN ] (screen)\$ $NORMAL"
     39    else
     40      PS1="$CYAN\u@\h [ $NORMAL\w$CYAN ]\$ $NORMAL"
     41    fi
     42  fi
     43fi
     44
     45unset RED GREEN MAGENTA YELLOW CYAN NORMAL
     46}}}
     47
    148
    249== Bash Shell Startup Files ==