Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.24 KB | None | 0 0
  1. if [ -r ~/.profile ]; then . ~/.profile; fi
  2. case "$-" in *i*) if [ -r ~/.bashrc ]; then . ~/.bashrc; fi;; esac
  3.  
  4. +----------------+-----------+-----------+------+
  5. | |Interactive|Interactive|Script|
  6. | |login |non-login | |
  7. +----------------+-----------+-----------+------+
  8. |/etc/profile | A | | |
  9. +----------------+-----------+-----------+------+
  10. |/etc/bash.bashrc| | A | |
  11. +----------------+-----------+-----------+------+
  12. |~/.bashrc | | B | |
  13. +----------------+-----------+-----------+------+
  14. |~/.bash_profile | B1 | | |
  15. +----------------+-----------+-----------+------+
  16. |~/.bash_login | B2 | | |
  17. +----------------+-----------+-----------+------+
  18. |~/.profile | B3 | | |
  19. +----------------+-----------+-----------+------+
  20. |BASH_ENV | | | A |
  21. +----------------+-----------+-----------+------+
  22. | | | | |
  23. +----------------+-----------+-----------+------+
  24. | | | | |
  25. +----------------+-----------+-----------+------+
  26. |~/.bash_logout | C | | |
  27. +----------------+-----------+-----------+------+
  28.  
  29. # For BASH: Read down the appropriate column. Executes A, then B, then C, etc.
  30. # The B1, B2, B3 means it executes only the first of those files found. (A)
  31. # or (B2) means it is normally sourced by (read by and included in) the
  32. # primary file, in this case A or B2.
  33. #
  34. # +---------------------------------+-------+-----+------------+
  35. # | | Interactive | non-Inter. |
  36. # +---------------------------------+-------+-----+------------+
  37. # | | login | non-login |
  38. # +---------------------------------+-------+-----+------------+
  39. # | | | | |
  40. # | ALL USERS: | | | |
  41. # +---------------------------------+-------+-----+------------+
  42. # |BASH_ENV | | | A | not interactive or login
  43. # | | | | |
  44. # +---------------------------------+-------+-----+------------+
  45. # |/etc/profile | A | | | set PATH & PS1, & call following:
  46. # +---------------------------------+-------+-----+------------+
  47. # |/etc/bash.bashrc | (A) | A | | Better PS1 + command-not-found
  48. # +---------------------------------+-------+-----+------------+
  49. # |/etc/profile.d/bash_completion.sh| (A) | | |
  50. # +---------------------------------+-------+-----+------------+
  51. # |/etc/profile.d/vte-2.91.sh | (A) | | | Virt. Terminal Emulator
  52. # |/etc/profile.d/vte.sh | (A) | | |
  53. # +---------------------------------+-------+-----+------------+
  54. # | | | | |
  55. # | A SPECIFIC USER: | | | |
  56. # +---------------------------------+-------+-----+------------+
  57. # |~/.bash_profile (bash only) | B1 | | | (doesn't currently exist)
  58. # +---------------------------------+-------+-----+------------+
  59. # |~/.bash_login (bash only) | B2 | | | (didn't exist) **
  60. # +---------------------------------+-------+-----+------------+
  61. # |~/.profile (all shells) | B3 | | | (doesn't currently exist)
  62. # +---------------------------------+-------+-----+------------+
  63. # |~/.bashrc (bash only) | (B2) | B | | colorizes bash: su=red, other_users=green
  64. # +---------------------------------+-------+-----+------------+
  65. # | | | | |
  66. # +---------------------------------+-------+-----+------------+
  67. # |~/.bash_logout | C | | |
  68. # +---------------------------------+-------+-----+------------+
  69. #
  70. # ** (sources !/.bashrc to colorize login, for when booting into non-gui)
  71.  
  72. # TIP: SEE TABLE in /etc/profile of BASH SETUP FILES AND THEIR LOAD SEQUENCE
  73.  
  74. ssh fedora29
  75. └─ -bash # login shell
  76. ├── /etc/profile
  77. | ├─ /etc/profile.d/*.sh
  78. | ├─ /etc/profile.d/sh.local
  79. | └─ /etc/bashrc
  80. ├── ~/.bash_profile
  81. | └─ ~/.bashrc
  82. | └─ /etc/bashrc
  83. |
  84. |
  85. └─ $ bash # non-login shell
  86. └─ ~/.bashrc
  87. └─ /etc/bashrc
  88. └─ /etc/profile.d/*.sh
  89.  
  90. ssh clearlinux
  91. └─ -bash # login shell
  92. ├── /usr/share/defaults/etc/profile
  93. | ├─ /usr/share/defaults/etc/profile.d/*
  94. | ├─ /etc/profile.d/*
  95. | └─ /etc/profile
  96. ├── ~/.bash_profile
  97. |
  98. |
  99. └─ $ bash # non-login shell
  100. ├─ /usr/share/defaults/etc/bash.bashrc
  101. | ├─ /usr/share/defaults/etc/profile
  102. | | ├─ /usr/share/defaults/etc/profile.d/*
  103. | | ├─ /etc/profile.d/*
  104. | | └─ /etc/profile
  105. | └─ /etc/profile
  106. └─ ~/.bashrc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement