Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Duplicate default tcsh prompt in bash' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Duplicate default tcsh prompt in bash
Authored by: DimpledChad on Dec 26, '01 11:43:06PM
I personally have grown accustomed to the default tcsh prompt in OSX. Therefore, when I switched to bash, I wanted to duplicate that configuration. Here is what I came up with:
from my .bashrc: export PS1="[h:w] u$TERMINUS "
This gives the desired result:
[localhost:~] username%
For $TERMINUS to display the correct character, you need to put this in your /etc/profile:
if [ "$UID" = "0" ] then TERMINUS="#" else TERMINUS="$" fi


[ Reply to This | # ]
No need for $TERMINUS
Authored by: thinkyhead on Dec 30, '01 06:04:49AM

... Just use the special character backslash-$ as described in the bash manpage. Your example becomes this instead:

export PS1="[backslash-h:backslash-w] backslash-u backslash-$ "



[ Reply to This | # ]