Unix shells when starting read .bashrc file and execute commands contained in them. What is this file and what do they execute?
feedback
|
migrated from stackoverflow.com Sep 30 '09 at 22:36
This question came from our site for professional and enthusiast programmers.
|
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 | ||||
feedback
|
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:
| |||
|
feedback
|
|
It should contain various "initialization" commands for your shell, e.g.:
| |||||
feedback
|
|
Just share some experience. After I installed Ubuntu 10.10, I started to run bash. But in the bash terminal window, I cannot even run the clear command. It kept telling me that the TERM enrironment variable is not set. After I add the following lines to the .bashrc file. Things are ok.
Hope this could help with your understanding. | |||
|
feedback
|
