Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Could you achieve the same outcome by spreading the logic though the three standard bash dotfiles? Standard names plus no symlinks, i could live with that.


Kind of... That's pretty much what mine had evolved into, a bunch of them sourcing each other and making sure they weren't recursively sourced for when they're used on a different OS/machine, with complex conditionals to re-detect if it was interactive or not and logic to try to not re-run things too often that was only supposed to be run on login... with no certainty that they were really doing what I intended in weird circumstances like `ssh ... command`.

But those wouldn't have been "shareable" or standard either- unless they were all shared as a group. When someone says "here are some lines from my .bash_profile"- they are not implying something by having them in bash_profile and not bashrc. No one in their right mind would think "must be something they only want to run when they log in." Instead, you take those lines and put them into your .bashrc or .profile or whatever you happen to have working well enough. Or, worse, someone says "here's my .bash_profile" and someone new to osx drops it in their home directory and all of a sudden nothing works because bash stopped looking at their .profile that already existed, while someone on linux drops it into their home directory and it looks like it's not doing anything at all.

etc. (: obviously people get it to work, and obviously "madness" was a euphemism, but I was tired of all the ambiguity.


You could also replace each of the dotfiles with a script to source the dispatcher. No redundant logic, and you don't mess with system files in a way that might screw up install scripts, etc. (But unless I'm missing something it doesn't seem like you'd break that much by using symlinks.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: