![]() |
|
|
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 |
| how to unset the readonly variable | Nidhi2177 | UNIX for Advanced & Expert Users | 2 | 09-12-2007 06:35 AM |
| Is there any way to set env variable in top level Makefile and unset when done | umen | Shell Programming and Scripting | 0 | 10-23-2005 09:15 AM |
| define length of variable | cbarker | UNIX for Dummies Questions & Answers | 10 | 04-01-2005 01:42 PM |
| How to define two variable in foreach command?? | geoquest | Shell Programming and Scripting | 14 | 08-22-2002 07:11 PM |
| Using Grep to Define a Variable | cspcspcsp | UNIX for Dummies Questions & Answers | 1 | 10-12-2001 01:22 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How do I define a particular dir in PATH variable and then unset that dir
How do I define a particular dir in front of PATH variable and then run some job and then at the end of job SET the PATH variable to original?
in a script, WILL something like this work: ORIG_PATH=$PATH export PATH=/dir1/dir2:$PATH RUN SOME JOBS ..... unset PATH EXPORT PATH=$ORIG_PATH Also is there a way to not UNSET the path and look for particular dir and take it out from PATH variable?? |
|
||||
|
if you define a value for PATH inside a script, the value is only changed as far as the process running the script is concerned. "Nobody" else is ever affected. I think this may be the simple answer to your question. Changes to a child environment variable are NOT reflected in the parent process' same environment variable.
|
|
|||||
|
Quote:
Quote:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|