Command prompt

Hi All,

Even changing .bash_profile, i am getting only

$

as command prompt.

My bash profile looks like this.

PS1="[\d \t \u@\h:\w ] $ "

stty columns 200
set -o vi

if i run

bash 

command and run

PS1="[\d \t \u@\h:\w ] $ "

then it is working as expected.

$ bash
bash-4.1$ PS1="[\d \t \u@\h:\w ] $ "
[Thu Dec 03 01:58:57 tibdata@qabox:~ ] $


Could you please help me how to resolve this issue by putting in .bash_profile?

Hello akshu.agni,

There is a Thumb Rule for editing .profile which is: If we are editing a .profile each time we should log out and login again to server/box, could you please let us know if you have done so.

Thanks,
R. Singh

Thanks for your reply.

Yup, done that, but no luck

Hello akshu,

PS1 is usually set in .bashrc , not .bash_profile . .profile type files are for setting environment variables. PS1 is a shell variable, not an environment variable. Chances are, you have a .bashrc that is also setting PS1, could you please try to set it in .bashrc and let me know how it goes.

Thanks,
R. Singh

Hi,

I noticed it was logging into korn shell, that is why .bash_profile wasn't working.

Now new command in .bash_profile is

PS1="${HOSTNAME}:\${PWD##*/} \$ "

Now working as expected.

I will contact my unix team to change default login to bash shell.

Thank you very much for your help.