![]() |
|
|
grep unix.com with google
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Our Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
How does the PATH environmental variable work?
Hello.
I have a question about how the PATH environment variable works. I wrote a script in $HOME/bin/gvim. I want it to be called instead of /usr/bin/gvim, so I've placed it before in the PATH. However, it is still the old one that is found. If I open an other terminal, I have the desired effect: the script in $HOME/bin is found I don't understand how it's possible to have two terminals where the PATH variable is the same, echo $PATH outputs the same thing, but the two don't find the same script. Could anyone explain me the subtlety I'm missing here? Thanks in advance. |
|
|||
|
Quote:
Sourcing the .profile did make the difference. Why do I need to re-run the .profile? |
|
|||
|
Thanks again for help
Now I know how I came up with two terminals with the PATH, but not the same call Here is what happened. I created a script in $HOME/bin/gvim It was not executable (forgot to chmod +x), but there is another farther in the PATH I call once gvim. I skips the one not executable, calls the second one. I changed with 'chmod +x' the first one. Surprisingly, it still skips the first one, and calls the second one. Except if I open another terminal. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| path of running script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| remove a path from PATH environment variable | madhu84 | Shell Programming and Scripting | 9 | 10-23-2009 04:02 AM |
| Conditional Compilation based on Environmental Variable in Unix | BrighterLater | High Level Programming | 2 | 05-07-2009 01:07 PM |
| setting ksh environmental variable | mefquik | Shell Programming and Scripting | 2 | 03-21-2009 12:51 PM |
| Environmental Variable | janemary.a | Shell Programming and Scripting | 2 | 05-15-2007 02:46 AM |
| Set Oracle Environmental Variable !! | uuser | Shell Programming and Scripting | 4 | 02-22-2006 02:46 PM |