![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Adding default search path for CPP | boyanov | UNIX for Dummies Questions & Answers | 1 | 09-10-2007 01:46 AM |
| $PWD shows absolute path vs path w/symbolic links | kornshellmaven | Shell Programming and Scripting | 3 | 06-13-2007 12:15 PM |
| vi - replacing a relative path with absolute path in a file | Yinzer955i | UNIX for Dummies Questions & Answers | 2 | 09-07-2006 11:47 AM |
| Question about Restricting Search path of FIND to current directory | super_duper_guy | UNIX for Dummies Questions & Answers | 2 | 10-17-2005 09:10 AM |
| home directory in search path | jpprial | UNIX for Dummies Questions & Answers | 2 | 09-10-2001 11:42 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
PATH directory search order
Hello
I using CygWin and am working on project that requires whereby after I make some code changes and rebuild I have to manually copy the updated files into the install directory to test them. There is a build output directory where these files placed, but the program will not run from there. It is mainly dll files that need updating. So I thought if I set up my path with the build output directory as the first path my program might search there first, and thereby find the updated dll if there is one. I tried changing my PATH using the following script something like: PATH="/cygdrive/d/dev/Builds/BuildOutputDir:.:" However, no matter what I do my application always seems to use the dll from the install directory if there is one. If I remove the dll from that directory and test by setting a few other directories in the PATH then I can see that the precedence of the directories is working correctly. Just I cannot remove the working directory... ![]() Is what I am trying to do possible? Is what I set my PATH to correct? Thanks in advance for your help. ![]() Last edited by bobban; 12-31-2008 at 10:36 PM.. |
|
||||
|
Just a quick comment. I occasionally use cygwin but don't know how close to a real unix shell it is.
1-With a real shell the directories are searched in the order they are found in the path statement. So PATH="/a:/b/1:etc..." the /a will be looked at first. 2-Dont forget to EXPORT your path! About once a week I work an extra 15min on a problem because I forgot to EXPORT the varaiable. 3-You may not have complete control of the path under Cygwin because MS Win may do some of its own hunting before the Cygwin path statement takes place. You will have to do some quick tests ![]() I hope this helps you consider some options.... JZ |
|
||||
|
Quote:
I have a script: newpath.sh and in that is the line: PATH="/cygdrive/d/dev/Builds/BuildOutputDir:.:" and I run it using the source command: . newpath.sh and after that, when I enter "printf $PATH" I can see it has updated. Am I missing something? |
|
||||
|
EXPORT allows changes to a variable to be global. If you have a shell opened and you change the path variable, then go to another shell window, the change will not show up. If you EXPORT it, it is like telling UNIX to notify all the programs that there is a new version of that variable.
|
|
||||
|
Thanks for that jwzumwalt, I really appreciate your help.
![]() |
| Sponsored Links | ||
|
|