source: chapter07/profile.xml@ b32e803

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.0 6.1 6.1.1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since b32e803 was b32e803, checked in by Zack Winkles <winkie@…>, 20 years ago

Committed Alexander's i18n patch

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3489 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 3.3 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6<sect1 id="ch-scripts-profile">
7<title>The Bash Shell Startup Files</title>
8<?dbhtml filename="profile.html"?>
9
10<para>The shell program <filename>/bin/bash</filename> (hereafter
11referred to as just "the shell") uses a collection of startup files to
12help create an environment to run in. Each file has a specific use and
13may affect login and interactive environments differently. The files in
14the <filename class="directory">/etc</filename> directory generally provide global
15settings. If an equivalent file exists in your home directory it may
16override the global settings.
17</para>
18
19<para>An interactive login shell is started after a successful login, using
20<filename>/bin/login</filename>, by reading the
21<filename>/etc/passwd</filename> file. An
22interactive non-login shell is started at the command-line (e.g.
23<prompt>[prompt]$</prompt><command>/bin/bash</command>). A non-interactive
24shell is usually present when a shell script is running. It is non-interactive
25because it is processing a script and not waiting for user input between
26commands.</para>
27
28<para>For more information see <command>info bash</command> --
29<emphasis role="strong">Nodes: Bash Startup Files and Interactive
30Shells.</emphasis></para>
31
32<para>The files <filename>/etc/profile</filename> and
33<filename>~/.bash_profile</filename> are read when the shell is invoked
34as an interactive login shell.</para>
35
36<para>A base <filename>/etc/profile</filename> created below only sets some
37environment variables necessary for Bash to accept keystrokes properly,
38even in non-English locale. Replace "ll" with the
39two-letter code for your language (e.g. "en") and
40"CC" with the two-letter code for your country
41(e.g. "GB"). Also you may need to specify
42(and this is actually the preferred form) your
43character encoding (e.g. "iso8859-1") after a dot (so that the result
44is "en_GB.iso8859-1").
45Issue the following command for more information:</para>
46
47<screen><userinput>man 3 setlocale</userinput></screen>
48
49<para>The list of all locales supported by glibc can be obtained by running
50the following command:</para>
51
52<screen><userinput>locale -a</userinput></screen>
53
54<para>Now, when you are sure about your locale settings, create the
55<filename>/etc/profile</filename> file:</para>
56<screen><userinput>cat &gt; /etc/profile &lt;&lt; "EOF"
57# Begin /etc/profile
58# Written for Linux From Scratch
59# by Alexander E. Patrakov
60
61export LC_ALL=ll_CC
62export LANG=ll_CC
63export INPUTRC=/etc/inputrc
64
65# End /etc/profile
66EOF</userinput></screen>
67
68<para>Setting the keyboard layout,
69the screen font and the locale-related environment variables
70are the only internationalization steps needed to support
71locales that use ordinary single-byte encodings and left-to-right
72writing direction. More complex cases (including UTF-8 based locales)
73require additional steps and additional patches because many applications
74tend to break in such conditions. Because of too little educational
75value for a typical reader, these steps and patches are not included
76in the LFS book and such locales are not supported by LFS in any way.
77</para>
78</sect1>
Note: See TracBrowser for help on using the repository browser.