LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   setting the PS1 enviroment variable in xterm (https://www.linuxquestions.org/questions/linux-general-1/setting-the-ps1-enviroment-variable-in-xterm-57272/)

qanopus 04-29-2003 05:56 AM

setting the PS1 enviroment variable in xterm
 
Hi there.
This is how the prompt on my xterm looks like : bash-2.05a#
I would like it to look like this : [sohail@linux ~/work] >
I can do this by setting the PS1 enviroment variable, like : export PS1="[\u@\h\w]>"

But how can I make it work automatically when I start an xterm? Making an entery in my ~/.bash_profile or ~/.bashrc won't work. I tried putting an entery in ~/.xinitrc but that doesn't work either. But how then?

unSpawn 04-29-2003 06:46 AM

It's handled from /etc/bashrc but personal customizations like
"case $TERM in xterm*) PS1="${WHATEVER}: ";; esac"
in ~/.bashrc should work as well.

trickykid 04-29-2003 08:41 AM

Re: setting the PS1 enviroment variable in xterm
 
Quote:

Originally posted by schatoor
But how can I make it work automatically when I start an xterm? Making an entery in my ~/.bash_profile or ~/.bashrc won't work. I tried putting an entery in ~/.xinitrc but that doesn't work either. But how then?
By default it should work after placing it in your .bashrc file in your home directory. Try something like this:

Code:

#Set the default shell prompt:

PS1='\u@\h:\w\$ '

export PS1

Then just close the xterm and reopen it or logout and relogin again for changes to take affect.


All times are GMT -5. The time now is 10:18 AM.