source: postlfs/config/profile.xml@ 99e8a229

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 99e8a229 was 99e8a229, checked in by Randy McMurchy <randy@…>, 19 years ago

Added index tags to the postlfs-profile instructions

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

  • Property mode set to 100644
File size: 21.1 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">
60<primary sortas="e-etc-profile-profile">/etc/profile</primary>
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">
399<primary
400sortas="e-etc-bashrc-profile">/etc/bashrc</primary>
401</indexterm>
402
[b554263]403<para>Here is a base <filename>/etc/bashrc</filename>. Comments in the
404file should explain everything you need.</para>
405
[766bbe40]406<screen><userinput><command>cat &gt; /etc/bashrc &lt;&lt; "EOF"</command>
407# Begin /etc/bashrc
[b554263]408# Written for Beyond Linux From Scratch
409# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
[ad33bab6]410# updated by Bruce Dubbs &lt;bdubbs@linuxfromscratch.org&gt;
411
412# Make sure that the terminal is set up properly for each shell
413
414if [ -f /etc/profile.d/tinker-term.sh ]; then
415 source /etc/profile.d/tinker-term.sh
416fi
417
418if [ -f /etc/profile.d/xterm-titlebars.sh ]; then
419 source /etc/profile.d/xterm-titlebars.sh
420fi
[b554263]421
422# System wide aliases and functions.
423
424# System wide environment variables and startup programs should go into
425# /etc/profile. Personal environment variables and startup programs
426# should go into ~/.bash_profile. Personal aliases and functions should
427# go into ~/.bashrc
428
429# Provides a colored /bin/ls command. Used in conjunction with code in
430# /etc/profile.
[1a396398]431
[b554263]432alias ls='ls --color=auto'
433
[1a396398]434# Provides prompt for non-login shells, specifically shells started
435# in the <application>X</application> environment. [Review the LFS archive thread titled
[dd362e5]436# PS1 Environment Variable for a great case study behind this script
437# addendum.]
[1a396398]438
[3383489]439#export PS1="[\u@\h \w]\\$ "
440export PS1='\u@\h:\w\$ '
[28a9992]441
[766bbe40]442# End /etc/bashrc
443<command>EOF</command></userinput></screen>
[1a396398]444</sect2>
445
[99e8a229]446<sect2 id="bash_profile-profile">
[1a396398]447<title><filename>~/.bash_profile</filename></title>
[99e8a229]448<indexterm zone="postlfs-config-profile bash_profile-profile">
449<primary sortas="e-AA.bash_profile-profile">~/.bash_profile</primary>
450</indexterm>
[b554263]451
[1a396398]452<para>Here is a base <filename>~/.bash_profile</filename>. If you want each
453new user to have this file automatically, just change the output of
454the command to <filename>/etc/skel/.bash_profile</filename> and check the
[cfc2a54]455permissions after the command is run. You can then copy
[1a396398]456<filename>/etc/skel/.bash_profile</filename> to the home directories of already
457existing users, including root, and set the owner and group appropriately.
[cfc2a54]458</para>
[b554263]459
[766bbe40]460<screen><userinput><command>cat &gt; ~/.bash_profile &lt;&lt; "EOF"</command>
461# Begin ~/.bash_profile
[b554263]462# Written for Beyond Linux From Scratch
463# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
[1a396398]464# updated by Bruce Dubbs &lt;bdubbs@linuxfromscratch.org&gt;
[b554263]465
[64d97b7c]466# Personal environment variables and startup programs.
[b554263]467
468# Personal aliases and functions should go in ~/.bashrc. System wide
469# environment variables and startup programs are in /etc/profile.
470# System wide aliases and functions are in /etc/bashrc.
471
[1a396398]472append () {
473 # First remove the directory
474 local IFS=':'
475 local NEWPATH
476 for DIR in $PATH; do
477 if [ "$DIR" != "$1" ]; then
[3f1b51a]478 NEWPATH=${NEWPATH:+$NEWPATH:}$DIR
[1a396398]479 fi
480 done
481
482 # Then append the directory
483 export PATH=$NEWPATH:$1
484}
485
[b554263]486if [ -f "$HOME/.bashrc" ] ; then
[7008de1]487 source $HOME/.bashrc
[b554263]488fi
489
490if [ -d "$HOME/bin" ] ; then
[1a396398]491 append $HOME/bin
[b554263]492fi
493
[1a396398]494unset append
[b554263]495
[766bbe40]496# End ~/.bash_profile
497<command>EOF</command></userinput></screen>
[1a396398]498</sect2>
499
[99e8a229]500<sect2 id="bashrc-profile">
[1a396398]501<title><filename>~/.bashrc</filename></title>
[99e8a229]502<indexterm zone="postlfs-config-profile bashrc-profile">
503<primary sortas="e-AA.bashrc-profile">~/.bashrc</primary>
504</indexterm>
[b554263]505
[1a396398]506<para>Here is a base <filename>~/.bashrc</filename>. The comments and
[8604d92f]507instructions for using <filename class="directory">/etc/skel</filename> for
[1a396398]508<filename>.bash_profile</filename> above also apply here. Only the target file
509names are different.</para>
[b554263]510
[766bbe40]511<screen><userinput><command>cat &gt; ~/.bashrc &lt;&lt; "EOF"</command>
512# Begin ~/.bashrc
[b554263]513# Written for Beyond Linux From Scratch
514# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
515
516# Personal aliases and functions.
517
518# Personal environment variables and startup programs should go in
[64d97b7c]519# ~/.bash_profile. System wide environment variables and startup
[b554263]520# programs are in /etc/profile. System wide aliases and functions are
521# in /etc/bashrc.
522
523if [ -f "/etc/bashrc" ] ; then
[7008de1]524 source /etc/bashrc
[b554263]525fi
526
[766bbe40]527# End ~/.bashrc
528<command>EOF</command></userinput></screen>
[1a396398]529</sect2>
530
531
[99e8a229]532<sect2 id="bash_logout-profile">
[1a396398]533<title><filename>~/.bash_logout</filename></title>
[99e8a229]534<indexterm zone="postlfs-config-profile bash_logout-profile">
535<primary sortas="e-AA.bash_logout-profile">~/.bash_logout</primary>
536</indexterm>
[b554263]537
[1a396398]538<para>This is an empty <filename>~/.bash_logout</filename> that can be used as
539a template. You will notice that the base <filename>~/.bash_logout</filename>
540does not include a <userinput>clear</userinput> command. This is because the
541clear is handled in the <filename>/etc/issue</filename> file.</para>
[b554263]542
[766bbe40]543<screen><userinput><command>cat &gt; ~/.bash_logout &lt;&lt; "EOF"</command>
544# Begin ~/.bash_logout
[b554263]545# Written for Beyond Linux From Scratch
546# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
547
548# Personal items to perform on logout.
549
[766bbe40]550# End ~/.bash_logout
551<command>EOF</command></userinput></screen>
[1a396398]552</sect2>
553
554
[99e8a229]555<sect2 id="etc-dircolors-profile">
[1a396398]556<title><filename>/etc/dircolors</filename></title>
[99e8a229]557<indexterm zone="postlfs-config-profile etc-dircolors-profile">
558<primary sortas="e-etc-dircolors-profile">/etc/dircolors</primary>
559</indexterm>
560<indexterm zone="postlfs-config-profile etc-dircolors-profile">
561<primary sortas="e-AA.dircolors-profile">~/.dircolors</primary>
562</indexterm>
[1a396398]563
[3b7081ba]564<para> If you want to use the <filename>dircolors</filename> capability, then
[1a396398]565run the following command. The <filename class="directory">/etc/skel</filename>
566setup steps seen above also can be used here to provide a
[99e8a229]567<filename>~/.dircolors</filename> file when a new user is set up. As before,
568just change the output file name on the following command and assure the
[692e12c]569permissions, owner, and group are correct on the files created and/or copied.
[cfc2a54]570</para>
571
[1a396398]572<screen><userinput><command>dircolors -p > /etc/dircolors</command></userinput></screen>
[b554263]573
[1a396398]574<para>If you wish to customize the colors used for different file types, you can
575edit the <filename>/etc/dircolors</filename> file. The instructions for setting
576the colors are embedded in the file.</para>
577
578
579<para>Finally, Ian Macdonald has written an excellent collection of tips and
[7008de1]580tricks to enhance your shell environment. You can read it online at
[99e8a229]581<ulink
582url="http://www.caliban.org/bash/index.shtml">
583http://www.caliban.org/bash/index.shtml</ulink>.</para>
[1a396398]584</sect2>
[b554263]585</sect1>
Note: See TracBrowser for help on using the repository browser.