Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On the advice to source .profile in .bashrc. #5819

Open
dbuenzli opened this issue Feb 1, 2024 · 1 comment
Open

On the advice to source .profile in .bashrc. #5819

dbuenzli opened this issue Feb 1, 2024 · 1 comment

Comments

@dbuenzli
Copy link
Contributor

dbuenzli commented Feb 1, 2024

I know people like @AltGr banged their head on the table quite a bit with these things. But I'm wondering whether this:

Do you want opam to modify ~/.profile? [N/y/f]
(default is 'no', use 'f' to choose a different file) y

User configuration:
  Updating ~/.profile.
[NOTE] Make sure that ~/.profile is well sourced in your ~/.bashrc.

is good advice. I just installed a bare debian (bookworm) on a pi and .profile has:

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
	. "$HOME/.bashrc"
    fi
fi

by default. (I also checked a few servers I manage that have earlier debian version and they all seem to have similar runes in the .profile).

So if you source your .profile in .bashrc you create an infinite loop and ssh quicks you out. Shouldn't opam rather add the rune to .bashrc and tell that you should make sure that .bashrc is well sourced from .profile :-) ?

@kit-ty-kate
Copy link
Member

Note for opam devs from the dev meeting: We currently don't differenciate between POSIX shell and bash. I think we should probably have a different case for bash and this way we can support it properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants