Changeset 5ba3d1d for chapter07/profile.xml
- Timestamp:
- 08/08/2004 02:11:27 AM (20 years ago)
- Branches:
- 6.0
- Children:
- 1dc34de7
- Parents:
- ef13657
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter07/profile.xml
ref13657 r5ba3d1d 11 11 12 12 <para>The shell program <command>/bin/bash</command> (hereafter 13 referred to as just <quote>the shell</quote>) uses a collection of startup files to14 help create an environment to run in. Each file has a specific use and 15 may affect login and interactive environments differently. The files in 16 the <filename class="directory">/etc</filename> directory generally provide global 17 settings. If an equivalent file exists in your home directory it may 18 override the global settings. 19 </para>13 referred to as <quote>the shell</quote>) uses a collection of startup 14 files to help create an environment to run in. Each file has a 15 specific use and may affect login and interactive environments 16 differently. The files in the <filename 17 class="directory">/etc</filename> directory provide global settings. 18 If an equivalent file exists in the home directory, it may override 19 the global settings.</para> 20 20 21 <para>An interactive login shell is started after a successful login, using22 <command>/bin/login</command>, by reading the23 <filename>/etc/passwd</filename> file. An24 i nteractive non-login shell is started at the command-line (e.g.,25 <prompt>[prompt]$</prompt><command>/bin/bash</command>). A non-interactive26 shell is usually present when a shell script is running. It is non-interactive 27 because it is processing a script and not waiting for user input between 28 commands.</para>21 <para>An interactive login shell is started after a successful login, 22 using <command>/bin/login</command>, by reading the 23 <filename>/etc/passwd</filename> file. An interactive non-login shell 24 is started at the command-line (e.g., 25 <prompt>[prompt]$</prompt><command>/bin/bash</command>). A 26 non-interactive shell is usually present when a shell script is 27 running. It is non-interactive because it is processing a script and 28 not waiting for user input between commands.</para> 29 29 30 <para>For more information see <command>info bash</command> -- 31 <emphasis role="strong">Nodes: Bash Startup Files and Interactive 32 Shells.</emphasis></para> 30 <para>For more information, see <command>info bash</command> -- Nodes: 31 Bash Startup Files and Interactive Shells.</para> 33 32 34 33 <para>The files <filename>/etc/profile</filename> and 35 <filename>~/.bash_profile</filename> are read when the shell is invoked36 as an interactive login shell.</para>34 <filename>~/.bash_profile</filename> are read when the shell is 35 invoked as an interactive login shell.</para> 37 36 38 <para>A base <filename>/etc/profile</filename> createdbelow sets some39 environment variables necessary for native language support. By setting them40 properly, you get: 41 </para> 37 <para>A base <filename>/etc/profile</filename> below sets some 38 environment variables necessary for native language support. Setting 39 them properly results in:</para> 40 42 41 <itemizedlist> 43 42 <listitem><para>the output of programs translated into your native 44 43 language;</para></listitem> 45 <listitem><para>correct classification of characters into letters, digits and 46 other classes - this is necessary for Bash to accept non-ASCII characters 47 in command lines properly in non-English locales;</para></listitem> 48 <listitem><para>the alphabetical sorting order correct for your 44 <listitem><para>correct classification of characters into letters, 45 digits and other classes. This is necessary for Bash to properly 46 accept non-ASCII characters in command lines in non-English 47 locales;</para></listitem> 48 <listitem><para>the correct alphabetical sorting order for the 49 49 country;</para></listitem> 50 <listitem><para> gooddefault paper size;</para></listitem>50 <listitem><para>appropriate default paper size;</para></listitem> 51 51 <listitem><para>correct formatting of monetary, time and date 52 52 values.</para></listitem> 53 53 </itemizedlist> 54 54 55 <para>This script also sets the INPUTRC environment variable that makes 56 <application>Bash</application> and <application>Readline</application> use 57 the <filename>/etc/inputrc</filename> file we created earlier.</para> 55 <para>This script also sets the <emphasis>INPUTRC</emphasis> 56 environment variable that makes <application>Bash</application> and 57 <application>Readline</application> use the 58 <filename>/etc/inputrc</filename> file created earlier.</para> 58 59 59 60 <para>Replace <replaceable>[ll]</replaceable> below with the 60 two-letter code for yourlanguage (e.g., <quote>en</quote>) and61 <replaceable>[CC]</replaceable> with the two-letter code for your country62 (e.g., <quote>GB</quote>). Also you may need to specify 63 (and this is actually the preferred form) your 64 character encoding (e.g. <quote>iso8859-1</quote>) after a dot65 (so that the result is <quote>en_GB.iso8859-1</quote>). 66 Issue thefollowing command for more information:</para>61 two-letter code for the desired language (e.g., <quote>en</quote>) and 62 <replaceable>[CC]</replaceable> with the two-letter code for the 63 appropriate country (e.g., <quote>GB</quote>). It may also be 64 necessary to specify (and this is actually the preferred form) the 65 character encoding (e.g. <quote>iso8859-1</quote>) after a dot (so 66 that the result is <quote>en_GB.iso8859-1</quote>). Issue the 67 following command for more information:</para> 67 68 68 69 <screen><userinput>man 3 setlocale</userinput></screen> … … 73 74 <screen><userinput>locale -a</userinput></screen> 74 75 75 <para> Now, when you are sure about your locale settings, create the76 <para>Once the proper locale settings have been determined, create the 76 77 <filename>/etc/profile</filename> file:</para> 77 78 … … 87 88 88 89 <note><para>The <quote>C</quote> (default) and <quote>en_US</quote> 89 (the recommended one for U SEnglish users) locales are90 (the recommended one for United States English users) locales are 90 91 different.</para></note> 91 92 92 <para>Setting the keyboard layout, 93 the screen font and the locale-related environment variables 94 are the only internationalization steps needed to support 95 locales that use ordinary single-byte encodings and left-to-right 96 writing direction. More complex cases (including UTF-8 based locales) 97 require additional steps and additional patches because many applications 98 tend to break in such conditions. Because of too little educational 99 value for a typical reader, these steps and patches are not included 100 in the LFS book and such locales are not supported by LFS in any way. 101 </para> 93 <para>Setting the keyboard layout, the screen font, and the 94 locale-related environment variables are the only internationalization 95 steps needed to support locales that use ordinary single-byte 96 encodings and left-to-right writing direction. More complex cases 97 (including UTF-8 based locales) require additional steps and 98 additional patches because many applications tend to not work properly 99 under such conditions. These steps and patches are not included in 100 the LFS book and such locales are not supported by LFS in any 101 way.</para> 102 102 103 </sect1> 104
Note:
See TracChangeset
for help on using the changeset viewer.