I am a beginner to bash and in general using shell. When I open a terminal, it comes up with a prompt like this:
myusername@dev94:~>
where myusername is in blue, dev94 is in red and > is in green (I understand that this color configuration is probably in my .bashrc file). Here is my question: When I type exit and hit enter, this happens:
myusername@dev94:~>
exit
exit
myusername@dev94:~>
The myusername@dev94:~> is all in black without any color. What is difference between the one in colors before I typed exit and the colorless one after I typed exit?
(On a side note, I only typed the first exit. The second exit comes by itself when I hit enter. Wondering where the second exit is coming from. Is it just a bash/shell thing in every shell?)
If I type exit again (at the colorless prompt) and hit enter, then shell closes. I can understand this that the shell process quits and the window is closed. My 2nd question:
Why didnt it close when I first typed exit at the colored prompt itself. Why did it go from the colored to the colorless prompt for the first exit command?
Thank you!
Maybe your shell sets a SHELL variable, but this isn’t a must, and it is not necessarily correct:
If you look with ps ax –forest at your process list:
you should find the ps command yourself, above that the inner Shell, above that the outer shell.