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

Chapter 4 should be .bashrc instead of .bash_profile #715

Open
hisacro opened this issue Feb 17, 2020 · 4 comments
Open

Chapter 4 should be .bashrc instead of .bash_profile #715

hisacro opened this issue Feb 17, 2020 · 4 comments

Comments

@hisacro
Copy link

hisacro commented Feb 17, 2020

I guess you mistook .bashrc for .bash_profile

"The ~/.bash_profile is a list of Unix commands that are run every time we open our terminal,"
.bashrc is being read by non-login shells and alias are usually defined in .bashrc

source

@matt-kita
Copy link

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

Just because something is "usually" there, doesn't necessarily mean it "always" has to be there.
It really depends on what you wish to achieve. And if you're currently running a login or a non-login interactive shell.
Question is: "Does it really matter (for non-experienced beginner)?"

@hisacro
Copy link
Author

hisacro commented Feb 24, 2020

Just because something is "usually" there, doesn't necessarily mean it "always" has to be there.

sourcing .bashrc becomes pointless and every time you need to logout to invoke changes in bash config.

being a beginner doesn't mean you have to unlearn things.
it's defined fairly simple in bash man page

@matt-kita
Copy link

matt-kita commented Feb 24, 2020

sourcing .bashrc becomes pointless and every time you need to logout to invoke changes in bash config.

You don't need to logout every time to invoke changes in bash config. It's also defined fairly simple in bash man page how to execute bash subshell as a login shell (or at least make it pretend to be). As is explained how to run bash login shell without any configuration (e.g. --noprofile --norc). Where is it stated that you have to unlearn things? Not by me. Looks like this discussion becomes as pointless as sourcing .bashrc :D

@archqua
Copy link

archqua commented Apr 17, 2020

Well, I'd agree that this part is not the best it could be. As far as I understand, adding source ~/.bash_profile to ~/.bashrc might be somewhat reasonable substitution for defining aliases in ~/.bashrc and it's worth mentioning. I was confused by this at first and it's not nice to confuse newbies (like me).

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

No branches or pull requests

3 participants