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?