bashprofile.xml 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. <sect1 id="ch06-bashprofile">
  2. <title>Creating $LFS/root/.bash_profile</title>
  3. <?dbhtml filename="bashprofile.html" dir="chapter06"?>
  4. <para>When we have entered the chroot'ed environment in the next section we
  5. want to export a couple of environment variables in that shell such as
  6. PS1, PATH and others variables which are good to have set. For that
  7. purpose we'll create the $LFS/root/.bash_profile file which will be read
  8. by bash when we enter the chroot environment.</para>
  9. <para>Create a new file <filename>$LFS/root/.bash_profile</filename>
  10. by running the following.</para>
  11. <para><screen><userinput>cat &gt; $LFS/root/.bash_profile &lt;&lt; "EOF"</userinput>
  12. # Begin /root/.bash_profile
  13. PS1='\u:\w\$ '
  14. PATH=/bin:/usr/bin:/sbin:/usr/sbin
  15. export PS1 PATH
  16. # End /root/.bash_profile
  17. <userinput>EOF</userinput></screen></para>
  18. <para>The PS1 variable is an environment variable that controls the appearance
  19. of the command prompt. See the bash man page for details how this variable
  20. is constructed. Additional environment variables, aliases and so forth that are
  21. needed and/or wanted can be added at your own discretion.</para>
  22. </sect1>