![]() |
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 |
| 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help required regarding Unix Signal | k_bijitesh | UNIX for Advanced & Expert Users | 9 | 01-09-2007 03:44 AM |
| UNIX Internals, Help required... | digdarshan | High Level Programming | 4 | 08-04-2005 03:54 AM |
| Coding Standard For Unix Shell Scripting!!! | Omkumar | Shell Programming and Scripting | 1 | 03-28-2005 12:19 PM |
| UNIX PATH info required PLEASE HELP (I'm new to unix) | akitachi | UNIX for Dummies Questions & Answers | 1 | 05-10-2002 02:37 PM |
| Unix Coding Standards | himanshu_s | UNIX for Dummies Questions & Answers | 3 | 12-06-2001 04:34 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Maybe you are confused by the fact that if you put a cd command into a file and then execute the file your working directory doesn't change.
This is because the script is executing in a subshell that inherits your current environment. When the script finishes any changes it made to its own environment are lost with it. The answer is to execute the script within your current environment rather than in a subprocess. This is called sourcing the script due to the command "source" used to accomplish this in the csh. It's still called sourcing the script even though the syntax is simply to use a dot in ksh or bash. So, if a file called script contains a cd command, then . script will change your current working directory. |
|
||||
|
Quote:
/abc1/abc2/abc3 and you want it to be /mnl1/mnl2/mnl3 then enter the command cd /mnl1/mnl2/mnl3 This bit of your question "by some coding within a script?" is what I was trying to answer but I'm now assuming that you didn't know you could change directories without using a script. |
|
||||
|
I am able to do that. Thanks a lot for the support.
![]() |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|