The fun part about .bashrc, .bash_profile, .profile, /etc/bash*, /etc/profile etc. is that their semantics vary wildly between linux-distros. Not even Ubuntu and Debian agree here.
You never quite know where, when and if .bashrc is sourced by the distro-templates. A .bash_profile that unconditionally sources .bashrc will work fine on one distro, on the next you will see it run multiple times, on yet another you run into an infinite recursion.
His approach is the correct one and you'll find a similar script in just about any sizable, heterogenous deployment.
Just because I "can" do something doesn't mean I "want" to do something or that it's the best way to use my time. That's like saying that we don't need expressive function names in code because we can just refer to the documentation.
You don't need to read the whole manual. It's hard when you're looking for something very specific, but in this case it's just the FILES section, so I'll try man bash and then /^FILES.
It's like saying /etc/services has 11033 lines in it. Well, use grep or search in the document.
Comments
You would never need to know the difference - because you can always read the man page.
Which man-page exactly?
The fun part about .bashrc, .bash_profile, .profile, /etc/bash*, /etc/profile etc. is that their semantics vary wildly between linux-distros. Not even Ubuntu and Debian agree here.
You never quite know where, when and if .bashrc is sourced by the distro-templates. A .bash_profile that unconditionally sources .bashrc will work fine on one distro, on the next you will see it run multiple times, on yet another you run into an infinite recursion.
His approach is the correct one and you'll find a similar script in just about any sizable, heterogenous deployment.
man bash
The INVOCATION part. You find this part by searching for the word "profile".
Just because I "can" do something doesn't mean I "want" to do something or that it's the best way to use my time. That's like saying that we don't need expressive function names in code because we can just refer to the documentation.
$ man bash | wc 5375 41026 312785
"From the Earth to the Moon" by Jules Verne has 39,985 words
You don't need to read the whole manual. It's hard when you're looking for something very specific, but in this case it's just the FILES section, so I'll try man bash and then /^FILES.
It's like saying /etc/services has 11033 lines in it. Well, use grep or search in the document.