comparison .bashrc @ 14:94cfcec3b5b6

When bash is called non-interactively, PS1 is unset. However, if it's a login shell, ~/.bash_profile is still sourced. Therefore, testing PS1 tells us if this is a login but non-interactive shell (such as: ssh host 'uptime'). Testing PS1 before setting it preserves that state for later tests if desired.
author huston@80426f53-59d1-405d-934b-f07cd76f4a1a
date Sun, 30 Aug 2009 06:49:10 +0000
parents dacbbae5965c
children b9896ae0733c
comparison
equal deleted inserted replaced
13:dacbbae5965c 14:94cfcec3b5b6
16 fi 16 fi
17 17
18 # 18 #
19 # Environment variables 19 # Environment variables
20 # 20 #
21 export PS1='\h:\w\$ ' 21 [[ "$PS1" ]] && export PS1='\h:\w\$ '
22 export PAGER=less 22 export PAGER=less
23 export EDITOR=vim 23 export EDITOR=vim
24 export RUBYLIB=$HOME/Installs/rubygems/lib 24 export RUBYLIB=$HOME/Installs/rubygems/lib
25 export GEM_HOME=$HOME/Installs/rubygems/gems 25 export GEM_HOME=$HOME/Installs/rubygems/gems
26 26