Skip to content

Commit 7bd2b4f

Browse files
committed
add .bash_profile and .profile don't source .bashrc
1 parent b690106 commit 7bd2b4f

File tree

5 files changed

+35
-6
lines changed

5 files changed

+35
-6
lines changed

dot_config/exact_bash/NOTES

+25-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,31 @@
11
https://wiki.archlinux.org/title/Bash
22

3-
All interactive shells source /etc/bash.bashrc and ~/.bashrc, while
4-
interactive login shells also source /etc/profile and ~/.bash_profile.
3+
---
54

5+
+----------------+-----------+-----------+------+
6+
| |Interactive|Interactive|Script|
7+
| |login |non-login | |
8+
+----------------+-----------+-----------+------+
9+
|/etc/profile | A | | |
10+
+----------------+-----------+-----------+------+
11+
|/etc/bash.bashrc| | A | |
12+
+----------------+-----------+-----------+------+
13+
|~/.bashrc | | B | |
14+
+----------------+-----------+-----------+------+
15+
|~/.bash_profile | B1 | | |
16+
+----------------+-----------+-----------+------+
17+
|~/.bash_login | B2 | | |
18+
+----------------+-----------+-----------+------+
19+
|~/.profile | B3 | | |
20+
+----------------+-----------+-----------+------+
21+
|BASH_ENV | | | A |
22+
+----------------+-----------+-----------+------+
23+
| | | | |
24+
+----------------+-----------+-----------+------+
25+
| | | | |
26+
+----------------+-----------+-----------+------+
27+
|~/.bash_logout | C | | |
28+
+----------------+-----------+-----------+------+
629
---
730

831
https://www.gnu.org/software/bash/manual/bash.html#Bash-Startup-Files

dot_config/exact_bash/profile.bash

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
if [[ -f "${HOME}/.profile" ]]; then
4+
source "${HOME}/.profile"
5+
fi
6+
7+
if [[ -f "${HOME}/.bashrc" ]]; then
8+
source "${HOME}/.bashrc"
9+
fi

dot_config/profile

-4
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,3 @@ done
155155
unset -v dir
156156

157157
unset -f __executable_exists __is_readable_file __path_append __path_prepend __path_remove
158-
159-
if [ -n "${BASH_VERSION:-}" ] && [ -f "${HOME}/.bashrc" ]; then
160-
. "${HOME}/.bashrc"
161-
fi

remove_dot_bash_profile

Whitespace-only changes.

symlink_dot_bash_profile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.config/bash/profile.bash

0 commit comments

Comments
 (0)