@kevin This is for Bash specifically. Each shell works a bit differently.
For login shells (interactive or not), it runs `/etc/profile`, then `~/.bash_profile`, `~/.bash_login`, and `~/.profile`.
For interactive non-login shells, it runs `~/.bashrc`.
For non-interactive non-login shells, you have to set `BASH_ENV` to a script to run before you run Bash. You need to give the full path of the script, I think.
If you are running a script or command over sshd (rather than logging in and interacting with commands as usual), it'll run `~/.bashrc`.
Here's the doc page: https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html
In reply to
Bryan Redeagle
@bryanredeagle@beige.party
Open source supporter. Telecom Engineer. Hobbyist Programmer. Mustachioed.
beige.party
Bryan Redeagle
@bryanredeagle@beige.party
Open source supporter. Telecom Engineer. Hobbyist Programmer. Mustachioed.
beige.party
@bryanredeagle@beige.party
·
Apr 05, 2026
1
1
0
Conversation (1)
Showing 0 of 1 cached locally.
Syncing comments from the remote thread. 1 more reply is still loading.
Loading comments...