![]() |
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 |
| Help Help Help in recursion | murtaza | Shell Programming and Scripting | 6 | 03-29-2007 10:26 AM |
| Problem with recursion in subdirectories | scotty_123 | Shell Programming and Scripting | 5 | 03-11-2007 05:51 AM |
| A Question On Recursion In Ksh | marlonus999 | Shell Programming and Scripting | 1 | 01-11-2007 07:09 AM |
| allow recursion on dns server? | xnightcrawl | UNIX for Advanced & Expert Users | 1 | 03-29-2006 10:36 AM |
| recursion too deep | swamy455 | Shell Programming and Scripting | 3 | 07-18-2005 03:18 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
recursion
I'm using the UNIX csh and i wish to use recursion to nav my way up (or down as it is) a given folder.
My little test script is called "r" and takes a folder as argv[1] (or $1) #!/bin/tcsh -f set allFiles = `ls -A $argv[1]` cd $argv[1] while ($#allFiles) if (-d $allFiles[1]) then echo $allFiles[1] # do whatever... r $allFiles[1] endif shift allFiles end echo done. however once it chages into a given dir the script "r" is no longer in the new dir and thus the process fails. I'm not the super user so I can not dump the script "r" in "bin". Can anyone help me do something similair? |
|
||||
|
Just use the absolute path of r.
instead of r $allFiles[1] use /full/path/name/r $allFiles[1] That was r will always be found wherever you are. At the moment 'r' is only going to be found in the directory you are in. Alternatively add the location of 'r' to your PATH. Same effect as putting it in bin - the reason that you could find it if it was in bin (regardless of where you are) is that bin is in your path......same logic. Last edited by peter.herlihy; 08-26-2002 at 03:35 AM.. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|