============================================== Setting up Startup Files: .profile and .bashrc ============================================== -IAN! idallen@idallen.ca Reference: Running Linux: Chapter 4, p.106-108 All startup file references are to files in your home directory ($HOME): $HOME/.bash_profile: If you use a Linux system (e.g. RedHat, Knoppix, Floppix, etc.), your login shell is already BASH and it reads ("sources") the .bash_profile file (instead of .profile) when you log in. As with .profile, .bash_profile is only read once by the login shell, not by any other shells you might start up after you log in. You can put things in this file that need to be done exactly once at login and that are inherited by other shells: - set PATH and/or TERM - set umask - set your erase character (backspace) - set your prompt PS1 (and export it: export PS1) Any aliases you define here will apply only to the BASH shell at login, not to any other shells you start. If you find that a nested shell is not inheriting PATH, TERM, or PS1, you must "export" the variable, e.g. "export PS1". $HOME/.bashrc: Every BASH shell reads ("sources") .bashrc when it first starts up. Every new BASH shell reads this file. Put things in this file that don't get inherited from parent shells: - set your bash aliases Any aliases you define in .bashrc will apply to all BASH shells. If you use Linux, the aliases you set in .bashrc apply to your login shell as well; since, your login shell is BASH. (ACADUNIX does not use BASH for your login shell.) On ACADUNIX, your shell is the Korn Shell (ksh) that uses the .profile file upon login: $HOME/.profile: ACADUNIX uses the Korn shell as your login shell. (The Korn shell is a Bourne-type shell similar to BASH.) The Korn shell reads ("sources") the file ".profile" only once when you first log in. You can put things in this file that need to be done exactly once at login and that are inherited by other shells. Any aliases you define here will apply only to the Korn shell at login, not to any other shells you start. If you find that a nested shell is not inheriting PATH, TERM, or PS1, you must "export" the variable, e.g. "export PS1". The last thing you can put in the .profile file on ACADUNIX is "bash", to execute the bash shell when you first log in to ACADUNIX.