Unix shells when starting read the .bashrc file and execute commands contained in them. What is this file and what do they execute?
|
migrated from stackoverflow.com Sep 30 '09 at 22:36
|
Actually, it's The bash man page is the authoritative reference:
The file is just shell commands. It is typically used to change prompts, set environment variables, and define shell procedures. Traditionally, the file "Not a login shell" means things like script launches and usually terminal windows started by window managers. Sometimes I set up *nix systems to have .bashrc and BASH_ENV just source .profile. As long as you don't stray outside of POSIX shell commands then you will get the same initialization in any shell. It's particularly valuable when
One reason this is all so complex is because sometimes people put things that produce output into shell startup files, or they unconditionally set prompts. This causes lots of problems when running shell programs and backtick commands within languages, not to mention |
||||
|
http://en.wikipedia.org/wiki/Bash Here are some tricks and tips: http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html Let us try to set the prompt so that it can display today’d date and hostname:
|
|||
|
|
|
It should contain various "initialization" commands for your shell, e.g.:
|
|||
|
I would like to just share some experience. After I installed Ubuntu 10.10, I started to run Bash. But in the Bash terminal window, I could not even run the clear command. It kept telling me that the TERM enrironment variable was not set. After I added the following lines to the
I hope this could help with your understanding. |
||||
|
|