![]() |
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 |
| How to change parent shell's variables? | pankai | Shell Programming and Scripting | 1 | 01-17-2008 04:32 PM |
| Script look for file ,sort and copy to other direcotry | reddi22 | Shell Programming and Scripting | 0 | 01-17-2008 03:56 PM |
| Awk and Variables | deepak4you | Shell Programming and Scripting | 4 | 11-15-2007 09:18 AM |
| Return to the Home direcotry | shoeb_syed | UNIX for Dummies Questions & Answers | 4 | 02-17-2006 01:47 AM |
| Can't delete a direcotry | oradbus | UNIX for Advanced & Expert Users | 0 | 05-31-2005 04:29 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
is this allowed?
cd ../$var inside of a for loop? I want to be able to go into a new folder in the same directory with each iteration of the loop. I want $var to change to the folder number I am trying to get into. |
|
||||
|
Yes. It is allowed. You can change directories using variables. Below is sample code to do that in which directories has the list of directories that needs to be accessed to get information.
for var in `cat directories` do cd ../$var pwd done |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|