News for hackers. Stuff that matters.
Re:Show HN: A fix for the .bash_profile .bashrc .profile mad... by ghshephard on Saturday August 11, 2012 @02:30AM (#4369589)
If I do a survey of 10 engineers who use Linux, and OS X every day - I'm willing to wager that 9/10 of them wouldn't be able to explain what should be in .bash_profile, .profile, and .bashrc. And I can almost guarantee you they couldn't explain the difference between OS X and Linux. I know I couldn't. I like the solution, actually:

  - .bashrc_all - always gets executed 
  - .bashrc_scripts - non-interactive bash execution
  - .bashrc_interactive - duh.
  - .bashrc_login - motd and friends (when you "login")
I'd have no problem remembering that. Why don't you think there is a problem, and, why do you believe this is a poor solution to that (nonexistent) problem?
Re:Show HN: A fix for the .bash_profile .bashrc .profile mad... by digisign on Saturday August 11, 2012 @02:55AM (#4369616)
Masochistic geeks are a dime a dozen. Once they've memorized an unintuitive design, there "is no problem."
Re:Show HN: A fix for the .bash_profile .bashrc .profile mad... by smegel on Saturday August 11, 2012 @03:12AM (#4369642)
I think most engineers can hack their way to .bashrc even if they don't know the exact differences between those files. And those that can't probably don't need to or can get someone to help them. I just don't see a huge problem out there that needs to be solved.

Why don't i like the solution? Well it breaks a well known standard which will confuse others: show me your bash_profile and bashrc...wait what they are the same?? Secondly it invokes the terror of symlinks and the spaghetti mess that often results.

Sort of a nice idea in theory but i would not do it in practice.

Re:Show HN: A fix for the .bash_profile .bashrc .profile mad... by cswetenham on Saturday August 11, 2012 @06:52AM (#4369866)
Am I correct in thinking that instead of symlinking .bashrc, etc. to new_bashrc.sh, you could simply have them 'source new_bashrc.sh'? This would also mean you could keep all your dotfiles in a git repository without worrying about the symlinks.
Re:Show HN: A fix for the .bash_profile .bashrc .profile mad... by nodata on Saturday August 11, 2012 @03:30AM (#4369672)
You would never need to know the difference - because you can always read the man page.
Re:Show HN: A fix for the .bash_profile .bashrc .profile mad... by moe on Saturday August 11, 2012 @08:40AM (#4369985)
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.

Re:Show HN: A fix for the .bash_profile .bashrc .profile mad... by nodata on Monday August 13, 2012 @10:36AM (#4376059)
man bash

The INVOCATION part. You find this part by searching for the word "profile".

Re:Show HN: A fix for the .bash_profile .bashrc .profile mad... by azylman on Saturday August 11, 2012 @03:44AM (#4369687)
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.
Re:Show HN: A fix for the .bash_profile .bashrc .profile mad... by slyall on Saturday August 11, 2012 @04:35AM (#4369737)
$ man bash | wc 5375 41026 312785

"From the Earth to the Moon" by Jules Verne has 39,985 words

Re:Show HN: A fix for the .bash_profile .bashrc .profile mad... by reidrac on Saturday August 11, 2012 @05:33AM (#4369803)
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.