source: postlfs/config/profile.xml@ 8558044

ken/refactor-virt lazarus qt5new trunk upgradedb
Last change on this file since 8558044 was 8558044, checked in by Pierre Labastie <pierre.labastie@…>, 5 months ago

Remove spaces at the end of lines

I know it is somewhat useless, but I don't like them for
two reasons: first they cannot be seen, and I do not like things I
cannot see. Second, git highlights them, and this is disturbing...

  • Property mode set to 100644
File size: 23.1 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=/usr/bin
158
159# Attempt to provide backward compatibility with LFS earlier than 11
160if [ ! -L /bin ]; then
161 pathappend /bin
162fi
163
164if [ $EUID -eq 0 ] ; then
165 pathappend /usr/sbin
166 if [ ! -L /sbin ]; then
167 pathappend /sbin
168 fi
169 unset HISTFILE
170fi
171
172# Setup some environment variables.
173export HISTSIZE=1000
174export HISTIGNORE="&amp;:[bf]g:exit"
175
176# Set some defaults for graphical systems
177export XDG_DATA_DIRS=${XDG_DATA_DIRS:-/usr/share/}
178export XDG_CONFIG_DIRS=${XDG_CONFIG_DIRS:-/etc/xdg/}
179export XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/tmp/xdg-$USER}
180
181# Setup a red prompt for root and a green one for users.
182NORMAL="\[\e[0m\]"
183RED="\[\e[1;31m\]"
184GREEN="\[\e[1;32m\]"
185if [[ $EUID == 0 ]] ; then
186 PS1="$RED\u [ $NORMAL\w$RED ]# $NORMAL"
187else
188 PS1="$GREEN\u [ $NORMAL\w$GREEN ]\$ $NORMAL"
189fi
190
191for script in /etc/profile.d/*.sh ; do
192 if [ -r $script ] ; then
193 . $script
194 fi
195done
196
197unset script RED GREEN NORMAL
198
199# End /etc/profile</literal>
200EOF</userinput></screen>
201
202 <sect3 id="etc-profile.d">
203 <title>The /etc/profile.d Directory</title>
204
205 <indexterm zone="postlfs-config-profile etc-profile.d">
206 <primary sortas="e-etc-profile.d">/etc/profile.d</primary>
207 </indexterm>
208
209 <para>
210 Now create the <filename class='directory'>/etc/profile.d</filename>
211 directory, where the individual initialization scripts are placed:
212 </para>
213
214<screen role="root"><userinput>install --directory --mode=0755 --owner=root --group=root /etc/profile.d</userinput></screen>
215
216 </sect3>
217
218 <sect3 id="etc-profile.d-bash-completion.sh">
219 <title>/etc/profile.d/bash_completion.sh</title>
220
221 <indexterm zone="postlfs-config-profile etc-profile.d-bash-completion.sh">
222 <primary sortas="e-etc-profile.d-bash-completion.sh">/etc/profile.d/bash_completion.sh</primary>
223 </indexterm>
224
225 <note>
226 <para>
227 Using the bash completion script below is controversial. Not all
228 users like it. It adds many (usually over 1000) lines to the bash
229 environment and makes it difficult to use the 'set' command to
230 examine simple environment variables. Omitting this script does
231 not interfere with the ability of bash to use the tab key for file
232 name completion.
233 </para>
234 </note>
235
236 <para>
237 This script imports bash completion scripts, installed by many
238 other BLFS packages, to allow TAB command line completion.
239 </para>
240
241<screen role="root"><userinput>cat &gt; /etc/profile.d/bash_completion.sh &lt;&lt; "EOF"
242<literal># Begin /etc/profile.d/bash_completion.sh
243# Import bash completion scripts
244
245# If the bash-completion package is installed, use its configuration instead
246if [ -f /usr/share/bash-completion/bash_completion ]; then
247
248 # Check for interactive bash and that we haven't already been sourced.
249 if [ -n "${BASH_VERSION-}" -a -n "${PS1-}" -a -z "${BASH_COMPLETION_VERSINFO-}" ]; then
250
251 # Check for recent enough version of bash.
252 if [ ${BASH_VERSINFO[0]} -gt 4 ] || \
253 [ ${BASH_VERSINFO[0]} -eq 4 -a ${BASH_VERSINFO[1]} -ge 1 ]; then
254 [ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] &amp;&amp; \
255 . "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion"
256 if shopt -q progcomp &amp;&amp; [ -r /usr/share/bash-completion/bash_completion ]; then
257 # Source completion code.
258 . /usr/share/bash-completion/bash_completion
259 fi
260 fi
261 fi
262
263else
264
265 # bash-completions are not installed, use only bash completion directory
266 if shopt -q progcomp; then
267 for script in /etc/bash_completion.d/* ; do
268 if [ -r $script ] ; then
269 . $script
270 fi
271 done
272 fi
273fi
274
275# End /etc/profile.d/bash_completion.sh</literal>
276EOF</userinput></screen>
277 <para>
278 Make sure that the directory exists:
279 </para>
280
281<screen role="root"><userinput>install --directory --mode=0755 --owner=root --group=root /etc/bash_completion.d</userinput></screen>
282
283 <para>
284 For a more complete installation, see
285 <ulink url="&blfs-wiki;/bash-shell-startup-files#bash-completions"/>.
286 </para>
287
288 </sect3>
289
290 <sect3 id="etc-profile.d-dircolors.sh">
291 <title>/etc/profile.d/dircolors.sh</title>
292
293 <indexterm zone="postlfs-config-profile etc-profile.d-dircolors.sh">
294 <primary sortas="e-etc-profile.d-dircolors.sh">/etc/profile.d/dircolors.sh</primary>
295 </indexterm>
296
297 <para>
298 This script uses the <filename>~/.dircolors</filename> and
299 <filename>/etc/dircolors</filename> files to control the colors of
300 file names in a directory listing. They control colorized output of
301 things like <command>ls --color</command>. The explanation of how to
302 initialize these files is at the end of this section.
303 </para>
304
305<screen role="root"><userinput>cat &gt; /etc/profile.d/dircolors.sh &lt;&lt; "EOF"
306<literal># Setup for /bin/ls and /bin/grep to support color, the alias is in /etc/bashrc.
307if [ -f "/etc/dircolors" ] ; then
308 eval $(dircolors -b /etc/dircolors)
309fi
310
311if [ -f "$HOME/.dircolors" ] ; then
312 eval $(dircolors -b $HOME/.dircolors)
313fi
314
315alias ls='ls --color=auto'
316alias grep='grep --color=auto'</literal>
317EOF</userinput></screen>
318
319 </sect3>
320
321 <sect3 id="extrapaths.sh">
322 <title>/etc/profile.d/extrapaths.sh</title>
323
324 <indexterm zone="postlfs-config-profile extrapaths.sh">
325 <primary sortas="e-etc-profile.d-extrapaths.sh">/etc/profile.d/extrapaths.sh</primary>
326 </indexterm>
327
328 <para>
329 This script adds some useful paths to the <envar>PATH</envar> and
330 can be used to customize other PATH related environment variables
331 (e.g. LD_LIBRARY_PATH, etc) that may be needed for all users.
332 </para>
333
334<screen role="root"><userinput>cat &gt; /etc/profile.d/extrapaths.sh &lt;&lt; "EOF"
335<literal>if [ -d /usr/local/lib/pkgconfig ] ; then
336 pathappend /usr/local/lib/pkgconfig PKG_CONFIG_PATH
337fi
338if [ -d /usr/local/bin ]; then
339 pathprepend /usr/local/bin
340fi
341if [ -d /usr/local/sbin -a $EUID -eq 0 ]; then
342 pathprepend /usr/local/sbin
343fi
344
345# Set some defaults before other applications add to these paths.
346pathappend /usr/share/man MANPATH
347pathappend /usr/share/info INFOPATH</literal>
348EOF</userinput></screen>
349
350 </sect3>
351
352 <sect3 id="readline.sh">
353 <title>/etc/profile.d/readline.sh</title>
354
355 <indexterm zone="postlfs-config-profile readline.sh">
356 <primary sortas="e-etc-profile.d-readline.sh">/etc/profile.d/readline.sh</primary>
357 </indexterm>
358
359 <para>
360 This script sets up the default <filename>inputrc</filename>
361 configuration file. If the user does not have individual settings, it
362 uses the global file.
363 </para>
364
365<screen role="root"><userinput>cat &gt; /etc/profile.d/readline.sh &lt;&lt; "EOF"
366<literal># Setup the INPUTRC environment variable.
367if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ] ; then
368 INPUTRC=/etc/inputrc
369fi
370export INPUTRC</literal>
371EOF</userinput></screen>
372
373 </sect3>
374
375 <sect3 id="umask.sh">
376 <title>/etc/profile.d/umask.sh</title>
377
378 <indexterm zone="postlfs-config-profile umask.sh">
379 <primary sortas="e-etc-profile.d-umask.sh">/etc/profile.d/umask.sh</primary>
380 </indexterm>
381
382 <para>
383 Setting the <command>umask</command> value is important for security.
384 Here the default group write permissions are turned off for system
385 users and when the user name and group name are not the same.
386 </para>
387
388<screen role="root"><userinput>cat &gt; /etc/profile.d/umask.sh &lt;&lt; "EOF"
389<literal># By default, the umask should be set.
390if [ "$(id -gn)" = "$(id -un)" -a $EUID -gt 99 ] ; then
391 umask 002
392else
393 umask 022
394fi</literal>
395EOF</userinput></screen>
396
397 </sect3>
398
399<!-- This is handled in the Xorg section of the book
400 <sect3 id="X.sh">
401 <title>/etc/profile.d/X.sh</title>
402
403 <indexterm zone="postlfs-config-profile X.sh">
404 <primary sortas="e-etc-profile.d-X.sh">/etc/profile.d/X.sh</primary>
405 </indexterm>
406
407 <para>
408 If <application>X</application> is installed, the <envar>PATH</envar>
409 and <envar>PKG_CONFIG_PATH</envar> variables are also updated.
410 </para>
411
412<screen role="root"><userinput>cat &gt; /etc/profile.d/X.sh &lt;&lt; "EOF"
413<literal>if [ -x /usr/X11R6/bin/X ]; then
414 pathappend /usr/X11R6/bin
415fi
416if [ -d /usr/X11R6/lib/pkgconfig ] ; then
417 pathappend /usr/X11R6/lib/pkgconfig PKG_CONFIG_PATH
418fi</literal>
419EOF</userinput></screen>
420
421 </sect3>
422-->
423 <sect3 id="i18n.sh">
424 <!-- This is handled system wide on systemd but LANG is not exported to
425 the environment, hence it's return...need to add additional text for
426 systemd only -->
427 <title>/etc/profile.d/i18n.sh</title>
428
429 <indexterm zone="postlfs-config-profile i18n.sh">
430 <primary sortas="e-etc-profile.d-i18n.sh">/etc/profile.d/i18n.sh</primary>
431 </indexterm>
432
433 <para>
434 This script sets an environment variable necessary for
435 native language support. A full discussion on determining this
436 variable can be found on the <ulink
437 url="&lfs-root;/chapter09/profile.html">LFS Bash Shell
438 Startup Files</ulink> page.
439 </para>
440
441<screen role="root" revision="sysv"><userinput>cat &gt; /etc/profile.d/i18n.sh &lt;&lt; "EOF"
442<literal># Set up i18n variables
443export LANG=<replaceable>&lt;ll&gt;</replaceable>_<replaceable>&lt;CC&gt;</replaceable>.<replaceable>&lt;charmap&gt;</replaceable><replaceable>&lt;@modifiers&gt;</replaceable></literal>
444EOF</userinput></screen>
445
446<screen role="root" revision="systemd"><userinput>cat &gt; /etc/profile.d/i18n.sh &lt;&lt; "EOF"
447<literal># Set up i18n variables
448. /etc/locale.conf
449export LANG</literal>
450EOF</userinput></screen>
451
452 </sect3>
453
454 <sect3>
455 <title>Other Initialization Values</title>
456
457 <para>
458 Other initialization can easily be added to the
459 <filename>profile</filename> by adding additional scripts to the
460 <filename class='directory'>/etc/profile.d</filename> directory.
461 </para>
462
463 </sect3>
464
465 </sect2>
466
467 <sect2 id="etc-bashrc-profile">
468 <title>/etc/bashrc</title>
469
470 <indexterm zone="postlfs-config-profile etc-bashrc-profile">
471 <primary sortas="e-etc-bashrc">/etc/bashrc</primary>
472 </indexterm>
473
474 <para>
475 Here is a base <filename>/etc/bashrc</filename>. Comments in the
476 file should explain everything you need.
477 </para>
478
479<screen role="root"><userinput>cat &gt; /etc/bashrc &lt;&lt; "EOF"
480<literal># Begin /etc/bashrc
481# Written for Beyond Linux From Scratch
482# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
483# updated by Bruce Dubbs &lt;bdubbs@&lfs-domainname;&gt;
484
485# System wide aliases and functions.
486
487# System wide environment variables and startup programs should go into
488# /etc/profile. Personal environment variables and startup programs
489# should go into ~/.bash_profile. Personal aliases and functions should
490# go into ~/.bashrc
491
492# Provides colored /bin/ls and /bin/grep commands. Used in conjunction
493# with code in /etc/profile.
494
495alias ls='ls --color=auto'
496alias grep='grep --color=auto'
497
498# Provides prompt for non-login shells, specifically shells started
499# in the X environment. [Review the LFS archive thread titled
500# PS1 Environment Variable for a great case study behind this script
501# addendum.]
502
503NORMAL="\[\e[0m\]"
504RED="\[\e[1;31m\]"
505GREEN="\[\e[1;32m\]"
506if [[ $EUID == 0 ]] ; then
507 PS1="$RED\u [ $NORMAL\w$RED ]# $NORMAL"
508else
509 PS1="$GREEN\u [ $NORMAL\w$GREEN ]\$ $NORMAL"
510fi
511
512unset RED GREEN NORMAL
513
514# End /etc/bashrc</literal>
515EOF</userinput></screen>
516
517 </sect2>
518
519 <sect2 id="bash_profile-profile">
520 <title>~/.bash_profile</title>
521
522 <indexterm zone="postlfs-config-profile bash_profile-profile">
523 <primary sortas="e-AA.bash_profile">~/.bash_profile</primary>
524 </indexterm>
525
526 <para>
527 Here is a base <filename>~/.bash_profile</filename>. If you want each
528 new user to have this file automatically, just change the output of
529 the command to <filename>/etc/skel/.bash_profile</filename> and check the
530 permissions after the command is run. You can then copy <filename>
531 /etc/skel/.bash_profile</filename> to the home directories of already
532 existing users, including <systemitem class="username">root</systemitem>,
533 and set the owner and group appropriately.
534 </para>
535
536<screen><userinput>cat &gt; ~/.bash_profile &lt;&lt; "EOF"
537<literal># Begin ~/.bash_profile
538# Written for Beyond Linux From Scratch
539# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
540# updated by Bruce Dubbs &lt;bdubbs@&lfs-domainname;&gt;
541
542# Personal environment variables and startup programs.
543
544# Personal aliases and functions should go in ~/.bashrc. System wide
545# environment variables and startup programs are in /etc/profile.
546# System wide aliases and functions are in /etc/bashrc.
547
548if [ -f "$HOME/.bashrc" ] ; then
549 source $HOME/.bashrc
550fi
551
552if [ -d "$HOME/bin" ] ; then
553 pathprepend $HOME/bin
554fi
555
556# Having . in the PATH is dangerous
557#if [ $EUID -gt 99 ]; then
558# pathappend .
559#fi
560
561# End ~/.bash_profile</literal>
562EOF</userinput></screen>
563
564 </sect2>
565
566 <sect2 id="dot_profile-profile">
567 <title>~/.profile</title>
568
569 <indexterm zone="postlfs-config-profile dot_profile-profile">
570 <primary sortas="e-AA.dot_profile">~/.profile</primary>
571 </indexterm>
572
573 <para>
574 Here is a base <filename>~/.profile</filename>. The comments and
575 instructions for using <filename class="directory">/etc/skel</filename>
576 for <filename>.bash_profile</filename> above also apply here. Only the
577 target file names are different.
578 </para>
579
580<screen><userinput>cat &gt; ~/.profile &lt;&lt; "EOF"
581<literal># Begin ~/.profile
582# Personal environment variables and startup programs.
583
584if [ -d "$HOME/bin" ] ; then
585 pathprepend $HOME/bin
586fi
587
588# Set up user specific i18n variables
589#export LANG=<replaceable>&lt;ll&gt;</replaceable>_<replaceable>&lt;CC&gt;</replaceable>.<replaceable>&lt;charmap&gt;</replaceable><replaceable>&lt;@modifiers&gt;</replaceable>
590
591# End ~/.profile</literal>
592EOF</userinput></screen>
593
594 </sect2>
595
596 <sect2 id="bashrc-profile">
597 <title>~/.bashrc</title>
598
599 <indexterm zone="postlfs-config-profile bashrc-profile">
600 <primary sortas="e-AA.bashrc">~/.bashrc</primary>
601 </indexterm>
602
603 <para>
604 Here is a base <filename>~/.bashrc</filename>.
605 </para>
606
607<screen><userinput>cat &gt; ~/.bashrc &lt;&lt; "EOF"
608<literal># Begin ~/.bashrc
609# Written for Beyond Linux From Scratch
610# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
611
612# Personal aliases and functions.
613
614# Personal environment variables and startup programs should go in
615# ~/.bash_profile. System wide environment variables and startup
616# programs are in /etc/profile. System wide aliases and functions are
617# in /etc/bashrc.
618
619if [ -f "/etc/bashrc" ] ; then
620 source /etc/bashrc
621fi
622
623# Set up user specific i18n variables
624#export LANG=<replaceable>&lt;ll&gt;</replaceable>_<replaceable>&lt;CC&gt;</replaceable>.<replaceable>&lt;charmap&gt;</replaceable><replaceable>&lt;@modifiers&gt;</replaceable>
625
626# End ~/.bashrc</literal>
627EOF</userinput></screen>
628
629 </sect2>
630
631
632 <sect2 id="bash_logout-profile">
633 <title>~/.bash_logout</title>
634
635 <indexterm zone="postlfs-config-profile bash_logout-profile">
636 <primary sortas="e-AA.bash_logout">~/.bash_logout</primary>
637 </indexterm>
638
639 <para>
640 This is an empty <filename>~/.bash_logout</filename> that can be used as
641 a template. You will notice that the base <filename>~/.bash_logout
642 </filename> does not include a <userinput>clear</userinput> command.
643 This is because the clear is handled in the
644 <filename>/etc/issue</filename> file.
645 </para>
646
647<screen><userinput>cat &gt; ~/.bash_logout &lt;&lt; "EOF"
648<literal># Begin ~/.bash_logout
649# Written for Beyond Linux From Scratch
650# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
651
652# Personal items to perform on logout.
653
654# End ~/.bash_logout</literal>
655EOF</userinput></screen>
656
657 </sect2>
658
659
660 <sect2 id="etc-dircolors-profile">
661 <title>/etc/dircolors</title>
662
663 <indexterm zone="postlfs-config-profile etc-dircolors-profile">
664 <primary sortas="e-etc-dircolors">/etc/dircolors</primary>
665 </indexterm>
666
667 <indexterm zone="postlfs-config-profile etc-dircolors-profile">
668 <primary sortas="e-AA.dircolors">~/.dircolors</primary>
669 </indexterm>
670
671 <para>
672 If you want to use the <filename>dircolors</filename> capability, then
673 run the following command. The <filename class="directory">/etc/skel
674 </filename> setup steps shown above also can be used here to provide
675 a <filename>~/.dircolors</filename> file when a new user is set up.
676 As before, just change the output file name on the following command
677 and assure the permissions, owner, and group are correct on the files
678 created and/or copied.
679 </para>
680
681<screen role="root"><userinput>dircolors -p > /etc/dircolors</userinput></screen>
682
683 <para>
684 If you wish to customize the colors used for different file types, you
685 can edit the <filename>/etc/dircolors</filename> file. The instructions
686 for setting the colors are embedded in the file.
687 </para>
688
689
690 <para>
691 Finally, Ian Macdonald has written an excellent collection of tips and
692 tricks to enhance your shell environment. You can read it online at
693 <ulink url="http://www.caliban.org/bash/index.shtml"/>.
694 </para>
695
696 </sect2>
697
698</sect1>
Note: See TracBrowser for help on using the repository browser.