-
-
Notifications
You must be signed in to change notification settings - Fork 948
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
CLI walkthrough Adding ~/bin to $PATH in Bash #2154
Comments
@RikRoos So this issue can be closed? (You wrote that you solved this issue, so wondering if there is still an issue.) |
@kotp If putting the path export in I've been a mac user forever, and I am sure that on older macOS |
Yeah, the whole BSD/SystemV/Linux differences are confusing. The profile is used if it is a login shell that is going on, the bashrc is a resource file for the shell in more general sense. So it depends on the intention, what and when you want those settings. I believe the instructions are correct for what we generally want to do. The OP had their own desires, and so not sure if they are using it in a typical fashion. They said that they solved the issue as it pertains to their personal needs. I am not positive anything needs to be changed. (And no, the export in Would not the |
https://mywiki.wooledge.org/DotFiles Neither is more correct. The On the other hand, the Any argument that one is correct and the other is wrong is pretty hand wavy and I could argue for or against either. |
Hi,
The instruction page (https://exercism.org/cli-walkthrough) shows:
echo 'export PATH=~/bin:$PATH' >> ~/.bash_profile
source ~/.bash_profile
But the next time you start a shell (not the login-shell) the PATH variable will not reflect the change as .bash_profile will only be invoked during the start of the **login-**shell. I solved this issue to put the required PATH-statement into .bashrc
Taken from the man:
When bash is invoked as an interactive login shell, or as a non-inter‐
active shell with the --login option, it first reads and executes com‐
mands 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.
When an interactive shell that is not a login shell is started, bash
reads and executes commands from ~/.bashrc, if that file exists. This
may be inhibited by using the --norc option. The --rcfile file option
will force bash to read and execute commands from file instead of
~/.bashrc.
PS: I am running Arch linux.
The text was updated successfully, but these errors were encountered: