Michael Grau a écrit :
In /etc/profile.local
I have PS1 defined as
PS1=`echo '\n\h:\033[1m$PWD\033[0m\n# '` <- for root (if UID = 0) PS1=`echo '\n\h:\033[1m$PWD\033[0m\n# '` <- for others
How do I change the command line prompt when I "su" as opposed to "su -"?
Sorry for the newbie question ...
here's what I added in my .bashrc : test -e ~/.alias && . ~/.alias # User specific environment and startup programs if test "$UID" = 0 ; then PS1="\e[31m\h:\w # \e[0m" # ROOT has a red prompt else PS1="\e[32m\u@\h:\w \!>\e[0m " # user's prompt is green fi and .alias contains : alias a="alias" alias bug="/usr/X11R6/bin/xroach -speed 1.2 -squish -rgc yellowgreen -rc brown4" alias xx="startx &" alias su="/usr/X11R6/bin/sux" # <------ see comments below If you want anything specific after su'ing, then su has to read the new owner's environment, one way or the other. One way is su -, an other is to "automagically" call sux which also allows you to use the X display very usefull to call an X editor for admin from your own account. And please, don't be sorry for being a newby, oldbies are all ex-newbies, after all. -- ~adj~ Ces mystères nous dépassent Feignons d'en être l'organisateur...