source: postlfs/config/profile.xml@ 03b8993

11.0 11.1 11.2 11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 03b8993 was 45ab6c7, checked in by Xi Ruoyao <xry111@…>, 3 years ago

more SVN prop clean up

Remove "$LastChanged$" everywhere, and also some unused $Date$

  • Property mode set to 100644
File size: 22.9 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="postlfs-config-profile" xreflabel="The Bash Shell Startup Files">
9 <?dbhtml filename="profile.html"?>
10
11 <sect1info>
12 <date>$Date$</date>
13 </sect1info>
14
15 <title>The Bash Shell Startup Files</title>
16
17 <para>
18 The shell program <filename>/bin/bash</filename> (hereafter referred to
19 as just "the shell") uses a collection of startup files to help create
20 an environment. Each file has a specific use and may affect login and
21 interactive environments differently. The files in the <filename
22 class="directory">/etc</filename> directory generally provide global
23 settings. If an equivalent file exists in your home directory it may
24 override the global settings.
25 </para>
26
27 <para>
28 An interactive login shell is started after a successful login, using
29 <filename>/bin/login</filename>, by reading the
30 <filename>/etc/passwd</filename> file. This shell invocation normally reads
31 <filename>/etc/profile</filename> and its private equivalent
32 <filename>~/.bash_profile</filename> (or <filename>~/.profile</filename>
33 if called as <command>/bin/sh</command>) upon startup.
34 </para>
35
36 <para>
37 An interactive non-login shell is normally started at the command-line
38 using a shell program (e.g.,
39 <prompt>[prompt]$</prompt><command>/bin/bash</command>) or by the
40 <command>/bin/su</command> command. An interactive non-login shell is also
41 started with a terminal program such as <command>xterm</command> or
42 <command>konsole</command> from within a graphical environment. This type
43 of shell invocation normally copies the parent environment and then reads
44 the user's <filename>~/.bashrc</filename> file for additional startup
45 configuration instructions.
46 </para>
47
48 <para>
49 A non-interactive shell is usually present when a shell script is
50 running. It is non-interactive because it is processing a script and not
51 waiting for user input between commands. For these shell invocations, only
52 the environment inherited from the parent shell is used.
53 </para>
54
55 <para>
56 The file <filename>~/.bash_logout</filename> is not used for an
57 invocation of the shell. It is read and executed when a user exits from an
58 interactive login shell.
59 </para>
60
61 <para>
62 Many distributions use <filename>/etc/bashrc</filename> for system wide
63 initialization of non-login shells. This file is usually called from the
64 user's <filename>~/.bashrc</filename> file and is not built directly into
65 <command>bash</command> itself. This convention is followed in this
66 section.
67 </para>
68
69 <para>
70 For more information see <command>info bash</command> --
71 <emphasis role="strong">Nodes: Bash Startup Files and Interactive
72 Shells</emphasis>.
73 </para>
74
75 <note>
76 <para>
77 Most of the instructions below are used to create files located in the
78 <filename class='directory'>/etc</filename> directory structure which
79 requires you to execute the commands as the <systemitem
80 class='username'>root</systemitem> user. If you elect to create the
81 files in user's home directories instead, you should run the commands
82 as an unprivileged user.
83 </para>
84 </note>
85
86 <para condition="html" role="usernotes">User Notes:
87 <ulink url="&blfs-wiki;/bash-shell-startup-files"/></para>
88
89 <sect2 id="etc-profile-profile">
90 <title>/etc/profile</title>
91
92 <indexterm zone="postlfs-config-profile etc-profile-profile">
93 <primary sortas="e-etc-profile">/etc/profile</primary>
94 </indexterm>
95
96 <para>
97 Here is a base <filename>/etc/profile</filename>. This file starts by
98 setting up some helper functions and some basic parameters. It specifies
99 some <command>bash</command> history parameters and, for security
100 purposes, disables keeping a permanent history file for the <systemitem
101 class="username">root</systemitem> user. It also sets a default user
102 prompt. It then calls small, single purpose scripts in the <filename
103 class='directory'>/etc/profile.d</filename> directory to provide most
104 of the initialization.
105 </para>
106
107 <para>
108 For more information on the escape sequences you can use for your prompt
109 (i.e., the <envar>PS1</envar> environment variable) see <command>info
110 bash</command> -- <emphasis role="strong">Node: Printing a
111 Prompt</emphasis>.
112 </para>
113
114<screen role="root"><?dbfo keep-together="auto"?><userinput>cat &gt; /etc/profile &lt;&lt; "EOF"
115<literal># Begin /etc/profile
116# Written for Beyond Linux From Scratch
117# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
118# modifications by Dagmar d'Surreal &lt;rivyqntzne@pbzpnfg.arg&gt;
119
120# System wide environment variables and startup programs.
121
122# System wide aliases and functions should go in /etc/bashrc. Personal
123# environment variables and startup programs should go into
124# ~/.bash_profile. Personal aliases and functions should go into
125# ~/.bashrc.
126
127# Functions to help us manage paths. Second argument is the name of the
128# path variable to be modified (default: PATH)
129pathremove () {
130 local IFS=':'
131 local NEWPATH
132 local DIR
133 local PATHVARIABLE=${2:-PATH}
134 for DIR in ${!PATHVARIABLE} ; do
135 if [ "$DIR" != "$1" ] ; then
136 NEWPATH=${NEWPATH:+$NEWPATH:}$DIR
137 fi
138 done
139 export $PATHVARIABLE="$NEWPATH"
140}
141
142pathprepend () {
143 pathremove $1 $2
144 local PATHVARIABLE=${2:-PATH}
145 export $PATHVARIABLE="$1${!PATHVARIABLE:+:${!PATHVARIABLE}}"
146}
147
148pathappend () {
149 pathremove $1 $2
150 local PATHVARIABLE=${2:-PATH}
151 export $PATHVARIABLE="${!PATHVARIABLE:+${!PATHVARIABLE}:}$1"
152}
153
154export -f pathremove pathprepend pathappend
155
156# Set the initial path
157export PATH=/bin:/usr/bin
158
159if [ $EUID -eq 0 ] ; then
160 pathappend /sbin:/usr/sbin
161 unset HISTFILE
162fi
163
164# Setup some environment variables.
165export HISTSIZE=1000
166export HISTIGNORE="&amp;:[bf]g:exit"
167
168# Set some defaults for graphical systems
169export XDG_DATA_DIRS=${XDG_DATA_DIRS:-/usr/share/}
170export XDG_CONFIG_DIRS=${XDG_CONFIG_DIRS:-/etc/xdg/}
171export XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/tmp/xdg-$USER}
172
173# Setup a red prompt for root and a green one for users.
174NORMAL="\[\e[0m\]"
175RED="\[\e[1;31m\]"
176GREEN="\[\e[1;32m\]"
177if [[ $EUID == 0 ]] ; then
178 PS1="$RED\u [ $NORMAL\w$RED ]# $NORMAL"
179else
180 PS1="$GREEN\u [ $NORMAL\w$GREEN ]\$ $NORMAL"
181fi
182
183for script in /etc/profile.d/*.sh ; do
184 if [ -r $script ] ; then
185 . $script
186 fi
187done
188
189unset script RED GREEN NORMAL
190
191# End /etc/profile</literal>
192EOF</userinput></screen>
193
194 <sect3 id="etc-profile.d">
195 <title>The /etc/profile.d Directory</title>
196
197 <indexterm zone="postlfs-config-profile etc-profile.d">
198 <primary sortas="e-etc-profile.d">/etc/profile.d</primary>
199 </indexterm>
200
201 <para>
202 Now create the <filename class='directory'>/etc/profile.d</filename>
203 directory, where the individual initialization scripts are placed:
204 </para>
205
206<screen role="root"><userinput>install --directory --mode=0755 --owner=root --group=root /etc/profile.d</userinput></screen>
207
208 </sect3>
209
210 <sect3 id="etc-profile.d-bash-completion.sh">
211 <title>/etc/profile.d/bash_completion.sh</title>
212
213 <indexterm zone="postlfs-config-profile etc-profile.d-bash-completion.sh">
214 <primary sortas="e-etc-profile.d-bash-completion.sh">/etc/profile.d/bash_completion.sh</primary>
215 </indexterm>
216
217 <note>
218 <para>
219 Using the bash completion script below is controversial. Not all
220 users like it. It adds many (usually over 1000) lines to the bash
221 environment and makes it difficult to use the 'set' command to
222 examine simple environment variables. Omitting this script does
223 not interfere with the ability of bash to use the tab key for file
224 name completion.
225 </para>
226 </note>
227
228 <para>
229 This script imports bash completion scripts, installed by many
230 other BLFS packages, to allow TAB command line completion.
231 </para>
232
233<screen role="root"><userinput>cat &gt; /etc/profile.d/bash_completion.sh &lt;&lt; "EOF"
234<literal># Begin /etc/profile.d/bash_completion.sh
235# Import bash completion scripts
236
237# If the bash-completion package is installed, use its configuration instead
238if [ -f /usr/share/bash-completion/bash_completion ]; then
239
240 # Check for interactive bash and that we haven't already been sourced.
241 if [ -n "${BASH_VERSION-}" -a -n "${PS1-}" -a -z "${BASH_COMPLETION_VERSINFO-}" ]; then
242
243 # Check for recent enough version of bash.
244 if [ ${BASH_VERSINFO[0]} -gt 4 ] || \
245 [ ${BASH_VERSINFO[0]} -eq 4 -a ${BASH_VERSINFO[1]} -ge 1 ]; then
246 [ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] &amp;&amp; \
247 . "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion"
248 if shopt -q progcomp &amp;&amp; [ -r /usr/share/bash-completion/bash_completion ]; then
249 # Source completion code.
250 . /usr/share/bash-completion/bash_completion
251 fi
252 fi
253 fi
254
255else
256
257 # bash-completions are not installed, use only bash completion directory
258 if shopt -q progcomp; then
259 for script in /etc/bash_completion.d/* ; do
260 if [ -r $script ] ; then
261 . $script
262 fi
263 done
264 fi
265fi
266
267# End /etc/profile.d/bash_completion.sh</literal>
268EOF</userinput></screen>
269 <para>
270 Make sure that the directory exists:
271 </para>
272
273<screen role="root"><userinput>install --directory --mode=0755 --owner=root --group=root /etc/bash_completion.d</userinput></screen>
274
275 <para>
276 For a more complete installation, see
277 <ulink url="&blfs-wiki;/bash-shell-startup-files#bash-completions"/>.
278 </para>
279
280 </sect3>
281
282 <sect3 id="etc-profile.d-dircolors.sh">
283 <title>/etc/profile.d/dircolors.sh</title>
284
285 <indexterm zone="postlfs-config-profile etc-profile.d-dircolors.sh">
286 <primary sortas="e-etc-profile.d-dircolors.sh">/etc/profile.d/dircolors.sh</primary>
287 </indexterm>
288
289 <para>
290 This script uses the <filename>~/.dircolors</filename> and
291 <filename>/etc/dircolors</filename> files to control the colors of
292 file names in a directory listing. They control colorized output of
293 things like <command>ls --color</command>. The explanation of how to
294 initialize these files is at the end of this section.
295 </para>
296
297<screen role="root"><userinput>cat &gt; /etc/profile.d/dircolors.sh &lt;&lt; "EOF"
298<literal># Setup for /bin/ls and /bin/grep to support color, the alias is in /etc/bashrc.
299if [ -f "/etc/dircolors" ] ; then
300 eval $(dircolors -b /etc/dircolors)
301fi
302
303if [ -f "$HOME/.dircolors" ] ; then
304 eval $(dircolors -b $HOME/.dircolors)
305fi
306
307alias ls='ls --color=auto'
308alias grep='grep --color=auto'</literal>
309EOF</userinput></screen>
310
311 </sect3>
312
313 <sect3 id="extrapaths.sh">
314 <title>/etc/profile.d/extrapaths.sh</title>
315
316 <indexterm zone="postlfs-config-profile extrapaths.sh">
317 <primary sortas="e-etc-profile.d-extrapaths.sh">/etc/profile.d/extrapaths.sh</primary>
318 </indexterm>
319
320 <para>
321 This script adds some useful paths to the <envar>PATH</envar> and
322 can be used to customize other PATH related environment variables
323 (e.g. LD_LIBRARY_PATH, etc) that may be needed for all users.
324 </para>
325
326<screen role="root"><userinput>cat &gt; /etc/profile.d/extrapaths.sh &lt;&lt; "EOF"
327<literal>if [ -d /usr/local/lib/pkgconfig ] ; then
328 pathappend /usr/local/lib/pkgconfig PKG_CONFIG_PATH
329fi
330if [ -d /usr/local/bin ]; then
331 pathprepend /usr/local/bin
332fi
333if [ -d /usr/local/sbin -a $EUID -eq 0 ]; then
334 pathprepend /usr/local/sbin
335fi
336
337# Set some defaults before other applications add to these paths.
338pathappend /usr/share/man MANPATH
339pathappend /usr/share/info INFOPATH</literal>
340EOF</userinput></screen>
341
342 </sect3>
343
344 <sect3 id="readline.sh">
345 <title>/etc/profile.d/readline.sh</title>
346
347 <indexterm zone="postlfs-config-profile readline.sh">
348 <primary sortas="e-etc-profile.d-readline.sh">/etc/profile.d/readline.sh</primary>
349 </indexterm>
350
351 <para>
352 This script sets up the default <filename>inputrc</filename>
353 configuration file. If the user does not have individual settings, it
354 uses the global file.
355 </para>
356
357<screen role="root"><userinput>cat &gt; /etc/profile.d/readline.sh &lt;&lt; "EOF"
358<literal># Setup the INPUTRC environment variable.
359if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ] ; then
360 INPUTRC=/etc/inputrc
361fi
362export INPUTRC</literal>
363EOF</userinput></screen>
364
365 </sect3>
366
367 <sect3 id="umask.sh">
368 <title>/etc/profile.d/umask.sh</title>
369
370 <indexterm zone="postlfs-config-profile umask.sh">
371 <primary sortas="e-etc-profile.d-umask.sh">/etc/profile.d/umask.sh</primary>
372 </indexterm>
373
374 <para>
375 Setting the <command>umask</command> value is important for security.
376 Here the default group write permissions are turned off for system
377 users and when the user name and group name are not the same.
378 </para>
379
380<screen role="root"><userinput>cat &gt; /etc/profile.d/umask.sh &lt;&lt; "EOF"
381<literal># By default, the umask should be set.
382if [ "$(id -gn)" = "$(id -un)" -a $EUID -gt 99 ] ; then
383 umask 002
384else
385 umask 022
386fi</literal>
387EOF</userinput></screen>
388
389 </sect3>
390
391<!-- This is handled in the Xorg section of the book
392 <sect3 id="X.sh">
393 <title>/etc/profile.d/X.sh</title>
394
395 <indexterm zone="postlfs-config-profile X.sh">
396 <primary sortas="e-etc-profile.d-X.sh">/etc/profile.d/X.sh</primary>
397 </indexterm>
398
399 <para>
400 If <application>X</application> is installed, the <envar>PATH</envar>
401 and <envar>PKG_CONFIG_PATH</envar> variables are also updated.
402 </para>
403
404<screen role="root"><userinput>cat &gt; /etc/profile.d/X.sh &lt;&lt; "EOF"
405<literal>if [ -x /usr/X11R6/bin/X ]; then
406 pathappend /usr/X11R6/bin
407fi
408if [ -d /usr/X11R6/lib/pkgconfig ] ; then
409 pathappend /usr/X11R6/lib/pkgconfig PKG_CONFIG_PATH
410fi</literal>
411EOF</userinput></screen>
412
413 </sect3>
414-->
415 <sect3 id="i18n.sh">
416 <!-- This is handled system wide on systemd but LANG is not exported to
417 the environment, hence it's return...need to add additional text for
418 systemd only -->
419 <title>/etc/profile.d/i18n.sh</title>
420
421 <indexterm zone="postlfs-config-profile i18n.sh">
422 <primary sortas="e-etc-profile.d-i18n.sh">/etc/profile.d/i18n.sh</primary>
423 </indexterm>
424
425 <para>
426 This script sets an environment variable necessary for
427 native language support. A full discussion on determining this
428 variable can be found on the <ulink
429 url="&lfs-root;/chapter09/profile.html">LFS Bash Shell
430 Startup Files</ulink> page.
431 </para>
432
433<screen role="root" revision="sysv"><userinput>cat &gt; /etc/profile.d/i18n.sh &lt;&lt; "EOF"
434<literal># Set up i18n variables
435export LANG=<replaceable>&lt;ll&gt;</replaceable>_<replaceable>&lt;CC&gt;</replaceable>.<replaceable>&lt;charmap&gt;</replaceable><replaceable>&lt;@modifiers&gt;</replaceable></literal>
436EOF</userinput></screen>
437
438<screen role="root" revision="systemd"><userinput>cat &gt; /etc/profile.d/i18n.sh &lt;&lt; "EOF"
439<literal># Set up i18n variables
440. /etc/locale.conf
441export LANG</literal>
442EOF</userinput></screen>
443
444 </sect3>
445
446 <sect3>
447 <title>Other Initialization Values</title>
448
449 <para>
450 Other initialization can easily be added to the
451 <filename>profile</filename> by adding additional scripts to the
452 <filename class='directory'>/etc/profile.d</filename> directory.
453 </para>
454
455 </sect3>
456
457 </sect2>
458
459 <sect2 id="etc-bashrc-profile">
460 <title>/etc/bashrc</title>
461
462 <indexterm zone="postlfs-config-profile etc-bashrc-profile">
463 <primary sortas="e-etc-bashrc">/etc/bashrc</primary>
464 </indexterm>
465
466 <para>
467 Here is a base <filename>/etc/bashrc</filename>. Comments in the
468 file should explain everything you need.
469 </para>
470
471<screen role="root"><userinput>cat &gt; /etc/bashrc &lt;&lt; "EOF"
472<literal># Begin /etc/bashrc
473# Written for Beyond Linux From Scratch
474# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
475# updated by Bruce Dubbs &lt;bdubbs@&lfs-domainname;&gt;
476
477# System wide aliases and functions.
478
479# System wide environment variables and startup programs should go into
480# /etc/profile. Personal environment variables and startup programs
481# should go into ~/.bash_profile. Personal aliases and functions should
482# go into ~/.bashrc
483
484# Provides colored /bin/ls and /bin/grep commands. Used in conjunction
485# with code in /etc/profile.
486
487alias ls='ls --color=auto'
488alias grep='grep --color=auto'
489
490# Provides prompt for non-login shells, specifically shells started
491# in the X environment. [Review the LFS archive thread titled
492# PS1 Environment Variable for a great case study behind this script
493# addendum.]
494
495NORMAL="\[\e[0m\]"
496RED="\[\e[1;31m\]"
497GREEN="\[\e[1;32m\]"
498if [[ $EUID == 0 ]] ; then
499 PS1="$RED\u [ $NORMAL\w$RED ]# $NORMAL"
500else
501 PS1="$GREEN\u [ $NORMAL\w$GREEN ]\$ $NORMAL"
502fi
503
504unset RED GREEN NORMAL
505
506# End /etc/bashrc</literal>
507EOF</userinput></screen>
508
509 </sect2>
510
511 <sect2 id="bash_profile-profile">
512 <title>~/.bash_profile</title>
513
514 <indexterm zone="postlfs-config-profile bash_profile-profile">
515 <primary sortas="e-AA.bash_profile">~/.bash_profile</primary>
516 </indexterm>
517
518 <para>
519 Here is a base <filename>~/.bash_profile</filename>. If you want each
520 new user to have this file automatically, just change the output of
521 the command to <filename>/etc/skel/.bash_profile</filename> and check the
522 permissions after the command is run. You can then copy <filename>
523 /etc/skel/.bash_profile</filename> to the home directories of already
524 existing users, including <systemitem class="username">root</systemitem>,
525 and set the owner and group appropriately.
526 </para>
527
528<screen><userinput>cat &gt; ~/.bash_profile &lt;&lt; "EOF"
529<literal># Begin ~/.bash_profile
530# Written for Beyond Linux From Scratch
531# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
532# updated by Bruce Dubbs &lt;bdubbs@&lfs-domainname;&gt;
533
534# Personal environment variables and startup programs.
535
536# Personal aliases and functions should go in ~/.bashrc. System wide
537# environment variables and startup programs are in /etc/profile.
538# System wide aliases and functions are in /etc/bashrc.
539
540if [ -f "$HOME/.bashrc" ] ; then
541 source $HOME/.bashrc
542fi
543
544if [ -d "$HOME/bin" ] ; then
545 pathprepend $HOME/bin
546fi
547
548# Having . in the PATH is dangerous
549#if [ $EUID -gt 99 ]; then
550# pathappend .
551#fi
552
553# End ~/.bash_profile</literal>
554EOF</userinput></screen>
555
556 </sect2>
557
558 <sect2 id="dot_profile-profile">
559 <title>~/.profile</title>
560
561 <indexterm zone="postlfs-config-profile dot_profile-profile">
562 <primary sortas="e-AA.dot_profile">~/.profile</primary>
563 </indexterm>
564
565 <para>
566 Here is a base <filename>~/.profile</filename>. The comments and
567 instructions for using <filename class="directory">/etc/skel</filename>
568 for <filename>.bash_profile</filename> above also apply here. Only the
569 target file names are different.
570 </para>
571
572<screen><userinput>cat &gt; ~/.profile &lt;&lt; "EOF"
573<literal># Begin ~/.profile
574# Personal environment variables and startup programs.
575
576if [ -d "$HOME/bin" ] ; then
577 pathprepend $HOME/bin
578fi
579
580# Set up user specific i18n variables
581#export LANG=<replaceable>&lt;ll&gt;</replaceable>_<replaceable>&lt;CC&gt;</replaceable>.<replaceable>&lt;charmap&gt;</replaceable><replaceable>&lt;@modifiers&gt;</replaceable>
582
583# End ~/.profile</literal>
584EOF</userinput></screen>
585
586 </sect2>
587
588 <sect2 id="bashrc-profile">
589 <title>~/.bashrc</title>
590
591 <indexterm zone="postlfs-config-profile bashrc-profile">
592 <primary sortas="e-AA.bashrc">~/.bashrc</primary>
593 </indexterm>
594
595 <para>
596 Here is a base <filename>~/.bashrc</filename>.
597 </para>
598
599<screen><userinput>cat &gt; ~/.bashrc &lt;&lt; "EOF"
600<literal># Begin ~/.bashrc
601# Written for Beyond Linux From Scratch
602# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
603
604# Personal aliases and functions.
605
606# Personal environment variables and startup programs should go in
607# ~/.bash_profile. System wide environment variables and startup
608# programs are in /etc/profile. System wide aliases and functions are
609# in /etc/bashrc.
610
611if [ -f "/etc/bashrc" ] ; then
612 source /etc/bashrc
613fi
614
615# Set up user specific i18n variables
616#export LANG=<replaceable>&lt;ll&gt;</replaceable>_<replaceable>&lt;CC&gt;</replaceable>.<replaceable>&lt;charmap&gt;</replaceable><replaceable>&lt;@modifiers&gt;</replaceable>
617
618# End ~/.bashrc</literal>
619EOF</userinput></screen>
620
621 </sect2>
622
623
624 <sect2 id="bash_logout-profile">
625 <title>~/.bash_logout</title>
626
627 <indexterm zone="postlfs-config-profile bash_logout-profile">
628 <primary sortas="e-AA.bash_logout">~/.bash_logout</primary>
629 </indexterm>
630
631 <para>
632 This is an empty <filename>~/.bash_logout</filename> that can be used as
633 a template. You will notice that the base <filename>~/.bash_logout
634 </filename> does not include a <userinput>clear</userinput> command.
635 This is because the clear is handled in the
636 <filename>/etc/issue</filename> file.
637 </para>
638
639<screen><userinput>cat &gt; ~/.bash_logout &lt;&lt; "EOF"
640<literal># Begin ~/.bash_logout
641# Written for Beyond Linux From Scratch
642# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
643
644# Personal items to perform on logout.
645
646# End ~/.bash_logout</literal>
647EOF</userinput></screen>
648
649 </sect2>
650
651
652 <sect2 id="etc-dircolors-profile">
653 <title>/etc/dircolors</title>
654
655 <indexterm zone="postlfs-config-profile etc-dircolors-profile">
656 <primary sortas="e-etc-dircolors">/etc/dircolors</primary>
657 </indexterm>
658
659 <indexterm zone="postlfs-config-profile etc-dircolors-profile">
660 <primary sortas="e-AA.dircolors">~/.dircolors</primary>
661 </indexterm>
662
663 <para>
664 If you want to use the <filename>dircolors</filename> capability, then
665 run the following command. The <filename class="directory">/etc/skel
666 </filename> setup steps shown above also can be used here to provide
667 a <filename>~/.dircolors</filename> file when a new user is set up.
668 As before, just change the output file name on the following command
669 and assure the permissions, owner, and group are correct on the files
670 created and/or copied.
671 </para>
672
673<screen role="root"><userinput>dircolors -p > /etc/dircolors</userinput></screen>
674
675 <para>
676 If you wish to customize the colors used for different file types, you
677 can edit the <filename>/etc/dircolors</filename> file. The instructions
678 for setting the colors are embedded in the file.
679 </para>
680
681
682 <para>
683 Finally, Ian Macdonald has written an excellent collection of tips and
684 tricks to enhance your shell environment. You can read it online at
685 <ulink url="http://www.caliban.org/bash/index.shtml"/>.
686 </para>
687
688 </sect2>
689
690</sect1>
Note: See TracBrowser for help on using the repository browser.