Ignore:
Timestamp:
12/12/2003 01:43:31 AM (20 years ago)
Author:
Greg Schafer <greg@…>
Branches:
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, v5_1, v5_1_1, 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
Children:
9c8916b
Parents:
6213d4c
Message:

Fixed Bash startup files to handle HOME and PS1.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter05/chapter05.xml

    r6213d4c r07ecae2  
    353353
    354354<screen><userinput>cat &gt; ~/.bash_profile &lt;&lt; "EOF"</userinput>
    355 exec env -i TERM=$TERM /bin/bash
     355exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash
    356356<userinput>EOF</userinput></screen>
    357357
    358 <para>The <userinput>exec env -i TERM=$TERM /bin/bash</userinput> command
    359 creates a new instance of Bash with a completely empty environment, except for
    360 the TERM variable. This is needed to ensure that no unwanted and potentially
    361 hazardous environment variables from the host system leak into our build
    362 environment. The technique used here is a little non-standard but it achieves
    363 the goal of enforcing a clean environment. By way of explanation, the initial
    364 shell is a <emphasis>login</emphasis> shell which reads the
    365 <filename>.bash_profile</filename>. The new shell instance is a
     358<para>The
     359<userinput>exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash</userinput>
     360command creates a new instance of Bash with a completely empty environment,
     361except for the HOME, TERM and PS1 variables. This is needed to ensure that no
     362unwanted and potentially hazardous environment variables from the host system
     363leak into our build environment. The technique used here is a little
     364non-standard but it achieves the goal of enforcing a clean environment. By way
     365of explanation, the initial shell is a <emphasis>login</emphasis> shell which
     366reads the <filename>.bash_profile</filename>. The new shell instance is a
    366367<emphasis>non-login</emphasis> shell which reads the
    367368<filename>.bashrc</filename> (created next).</para>
     
    392393files and directories are only writable for their owner, but readable and
    393394executable for anyone.</para>
    394  
     395
    395396<para>The LFS variable should of course be set to the mount point you
    396397chose.</para>
Note: See TracChangeset for help on using the changeset viewer.