Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. cat > ~/.bash_profile << "EOF"
  2. exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash
  3. EOF
  4. Linux From Scratch - Version 6.7
  5. 28
  6. When logged on as user lfs, the initial shell is usually a login shell which reads the / etc/ profile of the
  7. host (probably containing some settings and environment variables) and then . bash_ profile. The exec env
  8. -i.../bin/bash command in the . bash_ profile file replaces the running shell with a new one with a completely
  9. empty environment, except for the HOME, TERM, and PS1 variables. This ensures that no unwanted and potentially
  10. hazardous environment variables from the host system leak into the build environment. The technique used here
  11. achieves the goal of ensuring a clean environment.
  12. The new instance of the shell is a non-login shell, which does not read the / etc/ profile or . bash_ profile
  13. files, but rather reads the . bashrc file instead. Create the . bashrc file now:
  14. cat > ~/.bashrc << "EOF"
  15. set +h
  16. umask 022
  17. LFS=/mnt/lfs
  18. LC_ALL=POSIX
  19. LFS_TGT=$(uname -m)-lfs-linux-gnu
  20. PATH=/tools/bin:/bin:/usr/bin
  21. export LFS LC_ALL LFS_TGT PATH
  22. EOF
  23. The se
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement