-
Notifications
You must be signed in to change notification settings - Fork 1
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
$PATH is getting sorted #5
Comments
Don’t you have to work in the morning? 2:30 is way too late to be working on dotfiles. On Dec 29, 2014, at 2:34 AM, AJ [email protected] wrote:
|
I'm off until Wednesday. :) Here is what is happening. When I say that it is getting sorted after quitting Terminal this is the output of
Once I source .bashrc this is the output of
As you can see once I source the .bashrc file brew's path is back in the front where is supposed to be as per line 82 Thank bro! |
Without line 91, the PATH is duplicated every time I source .bashrc. Here is my PATH after sourcing .bashrc three times.
|
OK, got it. It seems that your awk line should take care of it - pulls each record (separated by “:”) into an array, then tests each consecutive one to see if it already exists in the array - if it doesn’t, it gets printed. (and then the sed to remove that trailing “:” from awk (isn’t there a way to have awk not print a last ORS?)). Makes sense. I don’t think it’s the awk that’s breaking it. Maybe something about the difference between using “source” and starting a new shell? source is appending to the old path instead of destroying it? Because it’s running in the current (shell) process, it can’t destroy the path (which it needs to know where non-builtins live?)? Try exporting that last $PATH and see if it replaces instead of appends? I know it’s not what you’re after, but why not hard-code your PATH? On Dec 29, 2014, at 5:39 PM, AJ [email protected] wrote:
|
Also, I’m “working from home” most of this week (except tomorrow), as the office will be dead. We should do something. On Dec 29, 2014, at 6:29 PM, Eric Franson [email protected] wrote:
|
I'm not at a computer so forgive the mind-barf. The .bashrc I've got from your dotfiles is a symlink to another location. Logically it should be the same result as an actual file in that spot, but for testing can you make an actual ~/.bashrc with the current syntax? Also, do the various path-producing files (.bashrc, .profile, etc.) get sourced in a particular order? Perhaps another file is causing conflict?
|
@Bwoe The .dotfiles/bashrc file can be manually moved to ~/.bashrc and it will work just fine. The only reason I symlink it to the .dotfiles directory is so i can easily version control all of my dotfiles with git. @tigfox I am able to fix the issue for Mac OS (see screen shot) but the issue persists on Linux. |
so make that the last line in your .bashrc? Fuck, that feels like inception. Tomorrow, after fewer drinks. On Dec 29, 2014, at 8:59 PM, AJ [email protected] wrote:
|
@Bwoe @tigfox
In an attempt to remove duplicates from my $PATH I now have a strange behavior. Need some awk help here.
If you source the .bashrc file the $PATH appears in the correct order. But when you quit and open the Terminal, the $PATH is getting sorted.
Introduced here
https://github.com/AJ-Acevedo/dotfiles/blob/master/bashrc#L91
The text was updated successfully, but these errors were encountered: