source: postlfs/config/profile.xml@ 90e2fb4e

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.0 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 90e2fb4e was 6a2bce2, checked in by Randy McMurchy <randy@…>, 19 years ago

Cleaned up indexing tags (should all be correct now)

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@3292 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 21.0 KB
RevLine 
[f8d632a]1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3 "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6]>
7
[78b3cd61]8<sect1 id="postlfs-config-profile" xreflabel="The Bash Shell Startup Files">
[a0f03b0]9<sect1info>
[5cd0959d]10<othername>$LastChangedBy$</othername>
11<date>$Date$</date>
[a0f03b0]12</sect1info>
[bae6e15]13<?dbhtml filename="profile.html"?>
[b554263]14<title>The Bash Shell Startup Files</title>
[f45b1953]15
[b554263]16<para>The shell program <filename>/bin/bash</filename> (hereafter
[64d97b7c]17referred to as just "the shell") uses a collection of startup files to
[1a396398]18help create an environment. Each file has a specific use and
[cfc2a54]19may affect login and interactive environments differently. The files in
[99e8a229]20the <filename class="directory">/etc</filename> directory generally provide
21global settings. If an equivalent file exists in your home directory it may
[cfc2a54]22override the global settings.
23</para>
24
25<para>An interactive login shell is started after a successful login, using
[1a396398]26<filename>/bin/login</filename>, by reading the <filename>/etc/passwd</filename>
27file. This shell invocation normally reads <filename>/etc/profile</filename>
[99e8a229]28and its private equivalent <filename>~/.bash_profile</filename> upon
29startup.</para>
[1a396398]30
31<para>An interactive non-login shell is normally started at the command-line
[0990cf7a]32(e.g., <prompt>[prompt]$</prompt><command>/bin/bash</command>) or by the
[1a396398]33<command>/bin/su</command> command. An interactive non-login shell is also
34started with a terminal program such as <command>xterm</command> or
35<command>konsole</command> from within a graphical environment. This type of
36shell invocation normally copies the parent environment and then reads the
37user's <filename>~/.bashrc</filename> file for additional startup configuration
38instructions.</para>
39
40<para>A non-interactive shell is usually present when a shell script is
41running. It is non-interactive because it is processing a script and not
[3b7081ba]42waiting for user input between commands. For these shell invocations, only
43the environment inherited from the parent shell is used.</para>
[1a396398]44
45<para> The file <filename>~/.bash_logout</filename> is not used for an
46invocation of the shell. It is read and executed when a user exits from an
47interactive login shell.</para>
48
[99e8a229]49<para>To the standard files, <filename>/etc/bashrc</filename> is called from
50the user's <filename>~/.bashrc</filename> for system wide initialization of
51non-login shells.</para>
[b554263]52
[766bbe40]53<para>For more information see <command>info bash</command> --
54<emphasis role="strong">Nodes: Bash Startup Files and Interactive
55Shells.</emphasis></para>
[b554263]56
[99e8a229]57<sect2 id="etc-profile-profile">
[1a396398]58<title><filename>/etc/profile</filename></title>
[99e8a229]59<indexterm zone="postlfs-config-profile etc-profile-profile">
[6a2bce2]60<primary sortas="e-etc-profile">/etc/profile</primary>
[99e8a229]61</indexterm>
[cfc2a54]62
[1a396398]63<para>Here is a base <filename>/etc/profile</filename>. This file starts by
64setting up some helper functions and some basic parameters. It specifies some
65<filename>bash</filename> history parameters and, for security purposes,
66disables keeping a permanent history file for the root user. It also sets a
67default user prompt. It then calls small, single purpose scripts in the
68<filename class='directory'>/etc/profile.d</filename> directory to provide most
69initialization. </para>
[b554263]70
[1a396398]71<para>For more information on the escape sequences you can use for your prompt
[0990cf7a]72(e.g., the <envar>PS1</envar> environment variable) see <command>info
[766bbe40]73bash</command> -- <emphasis role="strong">Node: Printing a
74Prompt.</emphasis></para>
[b554263]75
[766bbe40]76<screen><userinput><command>cat &gt; /etc/profile &lt;&lt; "EOF"</command>
77# Begin /etc/profile
[b554263]78# Written for Beyond Linux From Scratch
79# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
[1a396398]80# modifications by Dagmar d'Surreal &lt;rivyqntzne@pbzpnfg.arg&gt;
81
[b554263]82# System wide environment variables and startup programs.
[1a396398]83
[b554263]84# System wide aliases and functions should go in /etc/bashrc. Personal
85# environment variables and startup programs should go into
86# ~/.bash_profile. Personal aliases and functions should go into
87# ~/.bashrc.
[1a396398]88
89# Functions to help us manage paths. Second argument is the name of the
90# path variable to be modified (default: PATH)
91pathremove () {
92 local IFS=':'
93 local NEWPATH
94 local DIR
95 local PATHVARIABLE=${2:-PATH}
96 for DIR in ${!PATHVARIABLE} ; do
97 if [ "$DIR" != "$1" ] ; then
98 NEWPATH=${NEWPATH:+$NEWPATH:}$DIR
99 fi
100 done
101 export $PATHVARIABLE="$NEWPATH"
[b554263]102}
[1a396398]103
104pathprepend () {
105 pathremove $1 $2
106 local PATHVARIABLE=${2:-PATH}
107 export $PATHVARIABLE="$1${!PATHVARIABLE:+:${!PATHVARIABLE}}"
108}
109
110pathappend () {
111 pathremove $1 $2
112 local PATHVARIABLE=${2:-PATH}
113 export $PATHVARIABLE="${!PATHVARIABLE:+${!PATHVARIABLE}:}$1"
114}
115
[e9ef7b5e]116
117# Set the initial path
118export PATH=/bin:/usr/bin
119
[1a396398]120if [ $EUID -eq 0 ] ; then
[e9ef7b5e]121 pathappend /sbin:/usr/sbin
[1a396398]122 unset HISTFILE
[b554263]123fi
[1a396398]124
125# Setup some environment variables.
126export HISTSIZE=1000
127export HISTIGNORE="&amp;:[bf]g:exit"
128#export PS1="[\u@\h \w]\\$ "
129export PS1='\u@\h:\w\$ '
130
131for script in /etc/profile.d/*.sh ; do
[d3880c0]132 if [ -r $script ] ; then
[1a396398]133 . $script
134 fi
135done
136
[99e8a229]137# Now to clean up
[1a396398]138unset pathremove pathprepend pathappend
139
140# End /etc/profile
141<command>EOF</command></userinput></screen>
142
[99e8a229]143<sect3 id="etc-profile.d"><title>The /etc/profile.d directory</title>
144<indexterm zone="postlfs-config-profile etc-profile.d">
145<primary sortas="e-etc-profile.d">/etc/profile.d</primary>
146</indexterm>
147
148<para>Now create the <filename class='directory'>/etc/profile.d</filename>
149directory, where the individual initialization scripts are placed.</para>
[1a396398]150
151<screen><userinput><command>install --directory --mode=0755 --owner=root --group=root /etc/profile.d</command></userinput></screen>
[99e8a229]152</sect3>
[1a396398]153
[99e8a229]154<sect3 id="etc-profile.d-dircolors.sh">
[1a396398]155<title><filename>/etc/profile.d/dircolors.sh</filename></title>
[99e8a229]156<indexterm zone="postlfs-config-profile etc-profile.d-dircolors.sh">
157<primary
158sortas="e-etc-profile.d-dircolors.sh">/etc/profile.d/dircolors.sh</primary>
159</indexterm>
[1a396398]160
161<para>This script uses the <filename>~/.dircolors</filename> and
162<filename>/etc/dircolors</filename> files to control the colors of file names in a
163directory listing. They control colorized output of things like <command>ls
164--color</command>. The explaination of how to initialize these files is at the
[99e8a229]165end of this section.</para>
[1a396398]166
167<screen><userinput><command>cat &gt; /etc/profile.d/dircolors.sh &lt;&lt; "EOF"</command>
168# Setup for /bin/ls to support color, the alias is in /etc/bashrc.
169if [ -f "/etc/dircolors" ] ; then
170 eval $(dircolors -b /etc/dircolors)
171
172 if [ -f "$HOME/.dircolors" ] ; then
173 eval $(dircolors -b $HOME/.dircolors)
174 fi
[b554263]175fi
[1a396398]176alias ls='ls --color=auto'
177<command>EOF</command></userinput></screen>
178</sect3>
179
[99e8a229]180<sect3 id="extrapaths.sh">
[1a396398]181<title><filename>/etc/profile.d/extrapaths.sh</filename></title>
[99e8a229]182<indexterm zone="postlfs-config-profile extrapaths.sh">
183<primary
184sortas="e-etc-profile.d-extrapaths.sh">/etc/profile.d/extrapaths.sh</primary>
185</indexterm>
[1a396398]186
187<para>This script adds several useful paths to the <envar>PATH</envar> and
[99e8a229]188<envar>PKG_CONFIG_PATH</envar> environment variables. If you want, you can
189uncomment the last section to put a dot at the end of your path. This will
190allow executables in the current working directory to be executed without
191specifiying a ./, however you are warned that this is generally considered a
192security hazard.</para>
[1a396398]193
194<screen><userinput><command>cat &gt; /etc/profile.d/extrapaths.sh &lt;&lt; "EOF"</command>
195if [ -d /usr/local/lib/pkgconfig ] ; then
196 pathappend /usr/local/lib/pkgconfig PKG_CONFIG_PATH
197fi
198if [ -d /usr/local/bin ]; then
199 pathprepend /usr/local/bin
[b554263]200fi
[1a396398]201if [ -d /usr/local/sbin -a $EUID -eq 0 ]; then
202 pathprepend /usr/local/sbin
203fi
[d3880c0]204for directory in $(find /opt/*/lib/pkgconfig -type d 2>/dev/null); do
[1a396398]205 pathappend $directory PKG_CONFIG_PATH
206done
[d3880c0]207for directory in $(find /opt/*/bin -type d 2>/dev/null); do
[1a396398]208 pathappend $directory
209done
210if [ -d ~/bin ]; then
211 pathprepend ~/bin
212fi
213#if [ $EUID -gt 99 ]; then
214# pathappend .
215#fi
216<command>EOF</command></userinput></screen>
217</sect3>
[b554263]218
[99e8a229]219<sect3 id="readline.sh">
[1a396398]220<title><filename>/etc/profile.d/readline.sh</filename></title>
[99e8a229]221<indexterm zone="postlfs-config-profile readline.sh">
222<primary
223sortas="e-etc-profile.d-readline.sh">/etc/profile.d/readline.sh</primary>
224</indexterm>
[b554263]225
[99e8a229]226<para>This script sets up the default <filename>inputrc</filename>
227configuration file. If the user does not have individual settings, it uses the
228global file.</para>
[1a396398]229
230<screen><userinput><command>cat &gt; /etc/profile.d/readline.sh &lt;&lt; "EOF"</command>
[b554263]231# Setup the INPUTRC environment variable.
232if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ] ; then
[1a396398]233 INPUTRC=/etc/inputrc
[b554263]234fi
[1a396398]235export INPUTRC
236<command>EOF</command></userinput></screen>
237</sect3>
[b554263]238
[99e8a229]239<sect3 id="tinker-term.sh">
[1a396398]240<title><filename>/etc/profile.d/tinker-term.sh</filename></title>
[99e8a229]241<indexterm zone="postlfs-config-profile tinker-term.sh">
242<primary
243sortas="e-etc-profile.d-tinker-term.sh">/etc/profile.d/tinker-term.sh</primary>
244</indexterm>
[b554263]245
[99e8a229]246<para>Some applications need a specific <envar>TERM</envar> setting to support
247color.</para>
[1a396398]248
249<screen><userinput><command>cat &gt; /etc/profile.d/tinker-term.sh &lt;&lt; "EOF"</command>
[dd362e5]250# This will tinker with the value of TERM in order to convince certain
251# apps that we can, indeed, display color in their window.
[1a396398]252
253if [ -n "$COLORTERM" ]; then
254 export TERM=xterm-color
255fi
256
257if [ "$TERM" = "xterm" ]; then
258 export TERM=xterm-color
[b554263]259fi
[1a396398]260<command>EOF</command></userinput></screen>
261</sect3>
[b554263]262
[99e8a229]263<sect3 id="umask.sh">
[1a396398]264<title><filename>/etc/profile.d/umask.sh</filename></title>
[99e8a229]265<indexterm zone="postlfs-config-profile umask.sh">
266<primary
267sortas="e-etc-profile.d-umask.sh">/etc/profile.d/umask.sh</primary>
268</indexterm>
[1a396398]269
[99e8a229]270<para>Setting the <command>umask</command> value is important for security.
271Here the default group write permissions are turned off for system users and when
272the user name and group name are not the same.</para>
[b554263]273
[1a396398]274<screen><userinput><command>cat &gt; /etc/profile.d/umask.sh &lt;&lt; "EOF"</command>
275# By default we want the umask to get set.
276if [ "$(id -gn)" = "$(id -un)" -a $EUID -gt 99 ] ; then
277 umask 002
278else
279 umask 022
280fi
281<command>EOF</command></userinput></screen>
282</sect3>
283
[99e8a229]284<sect3 id="X.sh">
[1a396398]285<title><filename>/etc/profile.d/X.sh</filename></title>
[99e8a229]286<indexterm zone="postlfs-config-profile X.sh">
287<primary
288sortas="e-etc-profile.d-X.sh">/etc/profile.d/X.sh</primary>
289</indexterm>
[1a396398]290
[99e8a229]291<para>If <application>X</application> is installed, the <envar>PATH</envar>
292and <envar>PKG_CONFIG_PATH</envar> variables are also updated.</para>
[1a396398]293
294<screen><userinput><command>cat &gt; /etc/profile.d/X.sh &lt;&lt; "EOF"</command>
295if [ -x /usr/X11R6/bin/X ]; then
296 pathappend /usr/X11R6/bin
297fi
298if [ -d /usr/X11R6/lib/pkgconfig ] ; then
299 pathappend /usr/X11R6/lib/pkgconfig PKG_CONFIG_PATH
300fi
301<command>EOF</command></userinput></screen>
302</sect3>
303
[99e8a229]304<sect3 id="titlebars.sh">
[1a396398]305<title><filename>/etc/profile.d/xterm-titlebars.sh</filename></title>
[99e8a229]306<indexterm zone="postlfs-config-profile titlebars.sh">
307<primary
308sortas="e-etc-profile.d-titlebars.sh">/etc/profile.d/titlebars.sh</primary>
309</indexterm>
310
311<para>This script shows an example of a different way of setting the prompt.
312The normal variable, <envar>PS1</envar>, is supplemented by
313<envar>PROMPT_COMMAND</envar>. If set, the value of
314<envar>PROMPT_COMMAND</envar> is executed as a command prior to issuing each
315primary prompt.</para>
[1a396398]316
317<screen><userinput><command>cat &gt; /etc/profile.d/xterm-titlebars.sh &lt;&lt; "EOF"</command>
[dd362e5]318# The substring match ensures this works for "xterm" and "xterm-xfree86".
[1a396398]319if [ "${TERM:0:5}" = "xterm" ]; then
320 PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME} : ${PWD}\007"'
321 export PROMPT_COMMAND
322fi
[766bbe40]323<command>EOF</command></userinput></screen>
[0ca9f97]324</sect3>
325
[99e8a229]326<sect3 id="i18n.sh">
[0ca9f97]327<title><filename>/etc/profile.d/i18n.sh</filename></title>
[99e8a229]328<indexterm zone="postlfs-config-profile i18n.sh">
329<primary
330sortas="e-etc-profile.d-i18n.sh">/etc/profile.d/i18n.sh</primary>
331</indexterm>
[0ca9f97]332
333<para>This script shows how to set some environment variables necessary for
[d295e92]334native language support. Setting these variables properly gives you:</para>
335
336<itemizedlist spacing="compact">
337<listitem><para>the output of programs translated into your native
338language</para></listitem>
339<listitem><para>correct classification of characters into letters, digits and
340other classes &ndash; this is necessary for <application>Bash</application> to
341accept keystrokes properly in non-English locales</para></listitem>
342<listitem><para>the alphabetical sorting order correct for your
343country</para></listitem>
344<listitem><para>proper default paper size</para></listitem>
345<listitem><para>correct formatting of monetary, time and date
346values</para></listitem>
347</itemizedlist>
348
349<para>Replace <replaceable>[ll]</replaceable> with the two-letter code for
350your language (e.g., <quote>en</quote>) and
351<replaceable>[CC]</replaceable> with the two-letter code for your country
[0ca9f97]352(e.g., <quote>GB</quote>). Also you may need to specify (and this is actually
353the preferred form) your character encoding (e.g., <quote>iso8859-1</quote>)
354after a dot (so that the result is <quote>en_GB.iso8859-1</quote>). Issue the
355following command for more information:</para>
356
357<screen><userinput><command>man 3 setlocale</command></userinput></screen>
358
359<para>The list of all locales supported by <application>Glibc</application>
360can be obtained by running the following command:</para>
361
362<screen><userinput><command>locale -a</command></userinput></screen>
363
[d295e92]364<para>After you are sure about your locale settings, create the
[0ca9f97]365<filename>/etc/profile.d/i18n.sh</filename> file:</para>
366
367<screen><userinput><command>cat &gt; /etc/profile.d/i18n.sh &lt;&lt; "EOF"</command>
368# Set up i18n variables
[d295e92]369export LC_ALL=<replaceable>[ll]</replaceable>_<replaceable>[CC]</replaceable>
370export LANG=<replaceable>[ll]</replaceable>_<replaceable>[CC]</replaceable>
[ad59f9e2]371export G_FILENAME_ENCODING=@locale
[0ca9f97]372<command>EOF</command></userinput></screen>
[b554263]373
[99e8a229]374<para>The <envar>LC_ALL</envar> variable sets the same value for all locale
375categories. For better control, you may prefer to set values individually for
376all categories listed in the output of the <command>locale</command>
377command.</para>
[ad59f9e2]378
379<para>The <envar>G_FILENAME_ENCODING</envar> variable tells applications
380such as <application>Glib</application> and
381<application><acronym>GTK</acronym>+</application> that filenames are in
382the default locale encoding and not in <acronym>UTF</acronym>-8 as
383assumed by default.</para>
[11fcaea2]384</sect3>
[d295e92]385
386<sect3>
387<title><filename>Other initialization values</filename></title>
388
[99e8a229]389<para>Other initialization can easily be added to the
390<filename>profile</filename> by adding additional scripts to the
[1a396398]391<filename class='directory'>/etc/profile.d</filename> directory.</para>
392</sect3>
[0ca9f97]393
[1a396398]394</sect2>
395
[99e8a229]396<sect2 id="etc-bashrc-profile">
[1a396398]397<title><filename>/etc/bashrc</filename></title>
[99e8a229]398<indexterm zone="postlfs-config-profile etc-bashrc-profile">
[6a2bce2]399<primary sortas="e-etc-bashrc">/etc/bashrc</primary>
[99e8a229]400</indexterm>
401
[b554263]402<para>Here is a base <filename>/etc/bashrc</filename>. Comments in the
403file should explain everything you need.</para>
404
[766bbe40]405<screen><userinput><command>cat &gt; /etc/bashrc &lt;&lt; "EOF"</command>
406# Begin /etc/bashrc
[b554263]407# Written for Beyond Linux From Scratch
408# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
[ad33bab6]409# updated by Bruce Dubbs &lt;bdubbs@linuxfromscratch.org&gt;
410
411# Make sure that the terminal is set up properly for each shell
412
413if [ -f /etc/profile.d/tinker-term.sh ]; then
414 source /etc/profile.d/tinker-term.sh
415fi
416
417if [ -f /etc/profile.d/xterm-titlebars.sh ]; then
418 source /etc/profile.d/xterm-titlebars.sh
419fi
[b554263]420
421# System wide aliases and functions.
422
423# System wide environment variables and startup programs should go into
424# /etc/profile. Personal environment variables and startup programs
425# should go into ~/.bash_profile. Personal aliases and functions should
426# go into ~/.bashrc
427
428# Provides a colored /bin/ls command. Used in conjunction with code in
429# /etc/profile.
[1a396398]430
[b554263]431alias ls='ls --color=auto'
432
[1a396398]433# Provides prompt for non-login shells, specifically shells started
434# in the <application>X</application> environment. [Review the LFS archive thread titled
[dd362e5]435# PS1 Environment Variable for a great case study behind this script
436# addendum.]
[1a396398]437
[3383489]438#export PS1="[\u@\h \w]\\$ "
439export PS1='\u@\h:\w\$ '
[28a9992]440
[766bbe40]441# End /etc/bashrc
442<command>EOF</command></userinput></screen>
[1a396398]443</sect2>
444
[99e8a229]445<sect2 id="bash_profile-profile">
[1a396398]446<title><filename>~/.bash_profile</filename></title>
[99e8a229]447<indexterm zone="postlfs-config-profile bash_profile-profile">
[6a2bce2]448<primary sortas="e-AA.bash_profile">~/.bash_profile</primary>
[99e8a229]449</indexterm>
[b554263]450
[1a396398]451<para>Here is a base <filename>~/.bash_profile</filename>. If you want each
452new user to have this file automatically, just change the output of
453the command to <filename>/etc/skel/.bash_profile</filename> and check the
[cfc2a54]454permissions after the command is run. You can then copy
[1a396398]455<filename>/etc/skel/.bash_profile</filename> to the home directories of already
456existing users, including root, and set the owner and group appropriately.
[cfc2a54]457</para>
[b554263]458
[766bbe40]459<screen><userinput><command>cat &gt; ~/.bash_profile &lt;&lt; "EOF"</command>
460# Begin ~/.bash_profile
[b554263]461# Written for Beyond Linux From Scratch
462# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
[1a396398]463# updated by Bruce Dubbs &lt;bdubbs@linuxfromscratch.org&gt;
[b554263]464
[64d97b7c]465# Personal environment variables and startup programs.
[b554263]466
467# Personal aliases and functions should go in ~/.bashrc. System wide
468# environment variables and startup programs are in /etc/profile.
469# System wide aliases and functions are in /etc/bashrc.
470
[1a396398]471append () {
472 # First remove the directory
473 local IFS=':'
474 local NEWPATH
475 for DIR in $PATH; do
476 if [ "$DIR" != "$1" ]; then
[3f1b51a]477 NEWPATH=${NEWPATH:+$NEWPATH:}$DIR
[1a396398]478 fi
479 done
480
481 # Then append the directory
482 export PATH=$NEWPATH:$1
483}
484
[b554263]485if [ -f "$HOME/.bashrc" ] ; then
[7008de1]486 source $HOME/.bashrc
[b554263]487fi
488
489if [ -d "$HOME/bin" ] ; then
[1a396398]490 append $HOME/bin
[b554263]491fi
492
[1a396398]493unset append
[b554263]494
[766bbe40]495# End ~/.bash_profile
496<command>EOF</command></userinput></screen>
[1a396398]497</sect2>
498
[99e8a229]499<sect2 id="bashrc-profile">
[1a396398]500<title><filename>~/.bashrc</filename></title>
[99e8a229]501<indexterm zone="postlfs-config-profile bashrc-profile">
[6a2bce2]502<primary sortas="e-AA.bashrc">~/.bashrc</primary>
[99e8a229]503</indexterm>
[b554263]504
[1a396398]505<para>Here is a base <filename>~/.bashrc</filename>. The comments and
[8604d92f]506instructions for using <filename class="directory">/etc/skel</filename> for
[1a396398]507<filename>.bash_profile</filename> above also apply here. Only the target file
508names are different.</para>
[b554263]509
[766bbe40]510<screen><userinput><command>cat &gt; ~/.bashrc &lt;&lt; "EOF"</command>
511# Begin ~/.bashrc
[b554263]512# Written for Beyond Linux From Scratch
513# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
514
515# Personal aliases and functions.
516
517# Personal environment variables and startup programs should go in
[64d97b7c]518# ~/.bash_profile. System wide environment variables and startup
[b554263]519# programs are in /etc/profile. System wide aliases and functions are
520# in /etc/bashrc.
521
522if [ -f "/etc/bashrc" ] ; then
[7008de1]523 source /etc/bashrc
[b554263]524fi
525
[766bbe40]526# End ~/.bashrc
527<command>EOF</command></userinput></screen>
[1a396398]528</sect2>
529
530
[99e8a229]531<sect2 id="bash_logout-profile">
[1a396398]532<title><filename>~/.bash_logout</filename></title>
[99e8a229]533<indexterm zone="postlfs-config-profile bash_logout-profile">
[6a2bce2]534<primary sortas="e-AA.bash_logout">~/.bash_logout</primary>
[99e8a229]535</indexterm>
[b554263]536
[1a396398]537<para>This is an empty <filename>~/.bash_logout</filename> that can be used as
538a template. You will notice that the base <filename>~/.bash_logout</filename>
539does not include a <userinput>clear</userinput> command. This is because the
540clear is handled in the <filename>/etc/issue</filename> file.</para>
[b554263]541
[766bbe40]542<screen><userinput><command>cat &gt; ~/.bash_logout &lt;&lt; "EOF"</command>
543# Begin ~/.bash_logout
[b554263]544# Written for Beyond Linux From Scratch
545# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
546
547# Personal items to perform on logout.
548
[766bbe40]549# End ~/.bash_logout
550<command>EOF</command></userinput></screen>
[1a396398]551</sect2>
552
553
[99e8a229]554<sect2 id="etc-dircolors-profile">
[1a396398]555<title><filename>/etc/dircolors</filename></title>
[99e8a229]556<indexterm zone="postlfs-config-profile etc-dircolors-profile">
[6a2bce2]557<primary sortas="e-etc-dircolors">/etc/dircolors</primary>
[99e8a229]558</indexterm>
559<indexterm zone="postlfs-config-profile etc-dircolors-profile">
[6a2bce2]560<primary sortas="e-AA.dircolors">~/.dircolors</primary>
[99e8a229]561</indexterm>
[1a396398]562
[3b7081ba]563<para> If you want to use the <filename>dircolors</filename> capability, then
[1a396398]564run the following command. The <filename class="directory">/etc/skel</filename>
565setup steps seen above also can be used here to provide a
[99e8a229]566<filename>~/.dircolors</filename> file when a new user is set up. As before,
567just change the output file name on the following command and assure the
[692e12c]568permissions, owner, and group are correct on the files created and/or copied.
[cfc2a54]569</para>
570
[1a396398]571<screen><userinput><command>dircolors -p > /etc/dircolors</command></userinput></screen>
[b554263]572
[1a396398]573<para>If you wish to customize the colors used for different file types, you can
574edit the <filename>/etc/dircolors</filename> file. The instructions for setting
575the colors are embedded in the file.</para>
576
577
578<para>Finally, Ian Macdonald has written an excellent collection of tips and
[7008de1]579tricks to enhance your shell environment. You can read it online at
[99e8a229]580<ulink
581url="http://www.caliban.org/bash/index.shtml">
582http://www.caliban.org/bash/index.shtml</ulink>.</para>
[1a396398]583</sect2>
[b554263]584</sect1>
Note: See TracBrowser for help on using the repository browser.