Unix shells when starting read .bashrc file and execute commands contained in them. What is this file and what do they execute?
|
up vote
3
down vote
favorite
|
|||||
|
migrated from stackoverflow.com
|
up vote
4
down vote
accepted
|
Actually, it's The man page is the authoritive 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 |
||
|
|
|
up vote
2
down vote
|
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:
|
||
|
|
up vote
2
down vote
|
It should contain various "initialization" commands for your shell, e.g.:
|
||
|