Originally posted on akh's Fink Blog:

I just discovered that XQuartz on Mountain Lion does some annoying things to my PATH, changing:

/sw/lib/perl5/ExtUtils:/sw/bin:/sw/sbin:
/usr/bin:/bin:/usr/sbin:/sbin:
/usr/local/bin:
/opt/X11/bin:/Users/hansen/bin

in a Terminal window to

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:
/opt/X11/bin:
/sw/lib/perl5/ExtUtils:/sw/bin:/sw/sbin:
/usr/X11R6/bin:
/Users/hansen/bin:/Users/hansen/bin:
/opt/X11/bin

in an xterm.

The duplicate entries aren’t so bad, but moving the system directories in front of Fink’s is annoying.  Running pathsetup.sh again doesn’t change this, unfortunately.  I came up with a script which lets me reorder the PATH by blocks and remove via a pattern match any items I don’t want.  As an afterthought, it removes duplicates, too.  By running

export PATH=`pathformat.pl --delete=X11R6`

I am able to restore the PATH settings to the xterm that I have in my Terminal window. The pathformat.pl script follows:

#!/usr/bin/env perl -w # Read in the PATH environment variable and # 1) Strip out duplicate entries # 2) Delete entries matching a pattern given by instances of the --delete flag # 3)…

View original 85 more words

About these ads

One response to “

  1. Im having a hard time getting my database directories pathsetup file to work. this script looks to be the fix.. Thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s