What I want to accomplish is: changing the prompt color based on the directory I am using.
I have several OS versions installed, and for example, if I am cd's into another OS's directory structure, working on files there, I would like the prompt to be a different color than if I am in the home OS. All of the other OS's are accessed through /media -- /media/testing, /media/aptosid, etc., so a test that looks for "/media/" would work.
The idea here is that if I am changing files around, I can tell at a glance that I am doing it in the right place. So I don't, for example, change all of my source entries from "natty" to "oneiric" in my natty directory. You should be able to figure out from that example why I want to change the prompt colors...
The relevant /bashrc line is this:
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[00;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
but I'm not quite sure how to insert a test line in this, or even if it would work without reloading the shell.
I have several OS versions installed, and for example, if I am cd's into another OS's directory structure, working on files there, I would like the prompt to be a different color than if I am in the home OS. All of the other OS's are accessed through /media -- /media/testing, /media/aptosid, etc., so a test that looks for "/media/" would work.
The idea here is that if I am changing files around, I can tell at a glance that I am doing it in the right place. So I don't, for example, change all of my source entries from "natty" to "oneiric" in my natty directory. You should be able to figure out from that example why I want to change the prompt colors...
The relevant /bashrc line is this:
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[00;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
but I'm not quite sure how to insert a test line in this, or even if it would work without reloading the shell.
Comment