goup icon indicating copy to clipboard operation
goup copied to clipboard

.bash_profile and .profile

Open 5uy4n9 opened this issue 3 years ago • 0 comments

As bash docs says:

When Bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior.

and .profile is not only working for bash, but also for other shells

but seems like goup just simply insert source "$HOME/.go/env" to both .bash_profile and .profile, so if the .bash_profile not existed and .profile existed before goup installed, when goup installed, an interactive bash login shell will load .bash_profile and stop, the previous command existed in .profile will not execute so maybe insert source "$HOME/.profile" instead of source "$HOME/.go/env" for .bash_profile?

5uy4n9 avatar Oct 25 '22 19:10 5uy4n9