LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Setting PS1 variable for KDE Konsole shell (RH9) (https://www.linuxquestions.org/questions/linux-software-2/setting-ps1-variable-for-kde-konsole-shell-rh9-103627/)

robertmarkbram 10-13-2003 09:54 PM

Setting PS1 variable for KDE Konsole shell (RH9)
 
Howdy All!

I have set PS1 in my .bash_profile, but this has no effect on KDE's Konsole.


I seem to remember reading somewhere that it is a slightly different program and doesn't read the profile?


So how do I alter PS1 for Konsole so it will 'stick'?

Thanks for any advice!

Rob
:)

teval 10-13-2003 09:58 PM

Go into settings, configure knosole, click sessions.
In there click linux console, and look at how it's beeing invoked.
I usually use: bash --init-file ~/.bash_profile
It starts up bash with the bash_profile as the initfile

Skyline 10-13-2003 10:11 PM

Its ~/.bashrc that you'll need to modify.

For example - add something like this -

PS1=”\w Hello $”

choose your own characters.

Walt_R 10-13-2003 10:49 PM

CAUTION!!!
Before messing with these files, always make a copy of the original.
IE: cp .bashrc .bashrc.org

Just in case

PS1 can be set in .bashrc or .bash_profile, but it has to be exported. IE:

PS1=Waiting$
PS2=OOPS!
export PS1 PS2

to test the new .bashrc enter . .bashrc at the user prompt.

$ . .bashrc

This will re-execute the .bashrc file without rebooting either XWindows or the OS.

Walt R.

robertmarkbram 10-14-2003 07:38 PM

Thanks for the help - I just had to source ~/.bash_profile from ~/.bashrc:

# Source bash profile
if [ -f ~/.bash_profile ]
then
. ~/.bash_profile
fi

And remove the code in .bash_profile that sources .bashrc (to prevent an infinite loop!):

# Get the aliases and functions
#if [ -f ~/.bashrc ]; then
# . ~/.bashrc
#fi

Then it worked!

Rob
:)


All times are GMT -5. The time now is 08:48 AM.