Permalink
Browse files

[bash] Improved shell PS1 and got rid of /etc/issue error when it doe…

…sn't exist
  • Loading branch information...
1 parent 608ac72 commit c9632e95bdbb18c5d5277c0b3261c19ea34fdb91 @dansanduleac committed Mar 6, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 conf/bash/bash.d/06prefs
View
@@ -32,7 +32,7 @@ fi
if [ "$TERM" == "screen" -o "$TERM" == "screen.linux" ]; then
prompt_noscreen_str=
else
- prompt_noscreen_str=" (noscreen)"
+ prompt_noscreen_str=" (ns)"
fi
prompt_msgs="${prompt_shlvl}${prompt_chroot_str}${prompt_noscreen_str}"
@@ -53,7 +53,8 @@ case "$TERM" in
#PS1="[\\t${prompt_msgs} \\u@\\h \\W]\\$ "
;;
esac
-PS1="[\\t${prompt_msgs} ${clr_red}\\u${clr_end}@${clr_red}\\h${clr_end} ${clr_blue}\\W${clr_end}\$(git branch 2> /dev/null | grep -e '\* ' | sed 's/..\(.*\)/{\1}/')]\\$ "
+# @${clr_red}\\h${clr_end}
+PS1="[\\t${prompt_msgs} ${clr_red}\\u${clr_end} ${clr_blue}\\W${clr_end}\$(git branch 2> /dev/null | grep -e '\* ' | sed 's/..\(.*\)/{\1}/')]\\$ "
# Before each prompt, echo an escape sequence telling xterm or screen that
# a prompt is coming up, so that it can recognize command names
@@ -126,7 +127,7 @@ export PYTHONSTARTUP
# I install some downloaded packages in /home/simpkins/inst.
# Add this directory to my path
-OS_RELEASE=`head -1 /etc/issue`
+OS_RELEASE=`head -1 /etc/issue 2>/dev/null`
case "$OS_RELEASE" in
'CentOS release 5.2'*)
PLATFORM="centos5.2"

0 comments on commit c9632e9

Please sign in to comment.