Reblogged from 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.

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