Take the 2-minute tour ×  I'm using dash(sh) or bash or zsh. If
possible, I would prefer to put in common place.  I want to put
proper PS1 settings when I interactive with shell, so these
situation should be considered    1. login (show PS1)   2. su
3. sudo   4. script (Don't show PS1)  I was put PS1 on .bashrc,
but it seems not always workable.  share|improve this question
have you executed your code manually , means without bashrc , is
it working ?, if possible post your code. –  Rahul Patil Jan 18
'13 at 4:01 add comment  2 Answers  Each shell has its own
escape sequences for PS1, so you need to set it separately for
each shell. Furthermore, PS1 only makes sense for interactive
shells, it isn't used by other programs. So put PS1 in the
interactive startup file for your shell:    • ~/.bashrc for bash
• ~/.kshrc for ksh   • ~/.zshrc for zsh  Bash has a quirk: it
doesn't load .bashrc in a login shell, it only loads
~/.bash_profile or absent this ~/.profile. To fix this, put the
following lines in your ~/.