source: postlfs/config/profile.xml@ a4da374

lazarus trunk
Last change on this file since a4da374 was a4da374, checked in by Bruce Dubbs <bdubbs@…>, 2 months ago

Tweak path initialization

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