# HG changeset patch # User huston@80426f53-59d1-405d-934b-f07cd76f4a1a # Date 1251614950 0 # Node ID 94cfcec3b5b6c0428db981a615ad720ee16af370 # Parent dacbbae5965ce165a01725c636af874559f5ea79 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. diff -r dacbbae5965c -r 94cfcec3b5b6 .bashrc --- a/.bashrc Fri Aug 28 17:45:02 2009 +0000 +++ b/.bashrc Sun Aug 30 06:49:10 2009 +0000 @@ -18,7 +18,7 @@ # # Environment variables # -export PS1='\h:\w\$ ' +[[ "$PS1" ]] && export PS1='\h:\w\$ ' export PAGER=less export EDITOR=vim export RUBYLIB=$HOME/Installs/rubygems/lib