Exporting $PS1.

Ag. Hatzimanikas a.hatzim at gmail.com
Mon Mar 12 13:12:27 PDT 2007


A small correction to the second patch.
-------------- next part --------------
Index: postlfs/config/profile.xml
===================================================================
--- postlfs/config/profile.xml	(revision 6665)
+++ postlfs/config/profile.xml	(working copy)
@@ -141,7 +141,7 @@
 export HISTSIZE=1000
 export HISTIGNORE="&:[bf]g:exit"
 #export PS1="[\u@\h \w]\\$ "
-export PS1='\u@\h:\w\$ '
+PS1='\u@\h:\w\$ '
 
 for script in /etc/profile.d/*.sh ; do
         if [ -r $script ] ; then
@@ -395,8 +395,11 @@
 # PS1 Environment Variable for a great case study behind this script
 # addendum.]
 
-#export PS1="[\u@\h \w]\\$ "
-export PS1='\u@\h:\w\$ '
+if [[ ${EUID} == 0 ]] ; then
+        PS1='\e[0;31m\u@\h:\e[0;39m\w\$ '
+else
+        PS1='\e[0;32m\u@\h:\e[0;39m\w\$ '
+fi
 
 # End /etc/bashrc</literal>
 EOF</userinput></screen>


More information about the blfs-dev mailing list