This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PATH/.bashrc tip


As Earnie recently told, it's a good idea to have gnuwin32 
things at the front of the path when in bash.
So are the win32 things when not in bash!
This is both speeding things up and making things behave
as one expects when there are name clashes.
A good example could be the "find" program, having completely
different semantics in WINNT\SYSTEM32 and in the gnuwin32 bin dir.
(BTW, I personally hate the WINNT find and always delete it, :-)
I have a post-installation script for NT intsllation, to tailor some
things
NT setup doens't care of.).

So, here is an excerpt for a .bashrc file that does exactly the job of 
weeding gnuwin-ish things out of one's path and putting them in front:

## CUT HERE ##
declare -x PATH="`perl \
	-e "@path = split ':', '$PATH';"\
	-e '@path = grep {(m|/gnu|) ? (push (@gnu, $_) && undef) : 1; }
@path;'\
	-e '@path = grep {(m|^/usr|) ? (push (@usr, $_) && undef) : 1; }
@path;'\
	-e "print join (':', @gnu, @usr, @path);"`"

echo Path: $PATH
## CUT HERE ##

(I assume that you have a working perl in your original path.)

Folks, following the recent conversations re. contributing things vs. 
arguing about contributing -- could someone please instruct me if I
should submit
such small things somewhere? (You can just do it and CC the list as well
to prevent multiple submits).

vassilii
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]