Blame |
Last modification |
View Log
| RSS feed
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../../general.ent">
%general-entities;
]>
<sect1 id="ch-scripts-profile">
<title>The Bash Shell Startup Files</title>
<?dbhtml filename="profile.html"?>
<indexterm zone="ch-scripts-profile">
<primary sortas="e-/etc/profile">/etc/profile</primary>
</indexterm>
<para>The shell program <command>/bin/bash</command> (hereafter
referred to as <quote>the shell</quote>) uses a collection of startup
files to help create an environment to run in. Each file has a
specific use and may affect login and interactive environments
differently. The files in the <filename class="directory">/etc</filename>
directory provide global settings. If an equivalent file exists in the
home directory, it may override the global settings.</para>
<para>An interactive login shell is started after a successful login,
using <command>/bin/login</command>, by reading the
<filename>/etc/passwd</filename> file. An interactive non-login shell
is started at the command-line (e.g.,
<prompt>[prompt]$</prompt><command>/bin/bash</command>). A
non-interactive shell is usually present when a shell script is
running. It is non-interactive because it is processing a script and
not waiting for user input between commands.</para>
<para>For more information, see <command>info bash</command> under the
<emphasis>Bash Startup Files and Interactive Shells</emphasis> section,
and <ulink url="&cblfs-root;index.php/Bash_Startup_Files">Bash Startup
Files</ulink> in CBLFS.</para>
<para>The files <filename>/etc/profile</filename> and
<filename>~/.bash_profile</filename> are read when the shell is
invoked as an interactive login shell. In the next section, a base
<filename>/etc/profile</filename> will be created to set up locale
information.</para>
</sect1>