startup script
Daniel L Newhouse <[email protected]> Fri, 02 Jul 2021 03:00:23 -0500
| Newsgroups | alt.comp.lang.shell.unix.bourne-bash |
|---|---|
| Organization | Forte - www.forteinc.com |
| Message-ID | <[email protected]> |
To answer my original question, yes there is, and here is the quote from O'Reilly's Larning the Bash source executes the commands in the specified file, in this case .bash_profile, including any commands that you have added. bash allows two synonyms for .bash_profile: .bash_login, derived from the C shells file named .login, and .profile, derived from the Bourne shell and Korn shell files named .profile. Only one of these three is read when you log in. If .bash_profile doesnt exist in your home directory, then bash will look for .bash_login. If that doesnt exist it will look for .profile. One advantage of bashs ability to look for either synonym is that you can retain your .profile if you have been using the Bourne shell. If you need to add bash-specific commands, you can put them in .bash_profile followed by the command source .profile. When you log in, all the bash-specific commands will be executed, and bash will source .profile, executing the remaining commands. If you decide to switch to using the Bourne shell you dont have to modify your existing files. A similar approach was intended for .bash_login and the C shell .login, but due to differences in the basic syntax of the shells, this is not a good idea. Cameron Newham. Learning the bash Shell (In a Nutshell (O'Reilly)) (pp. 89-90). O'Reilly Media. Kindle Edition.