hi navin,

   from what i gather this is what you want to do:

   you have a directory like this

   a->b
    ->c->b
    ->c->d
    ->c->d->b

   and you want to change the permissions of all instances of b (sort of they fill a 
certain naming requirement, right?). if this is the case then you can use a recursive 
script that i got. it goees something like


   #!/bin/bash
   
   #note that this script is stored as $HOME/bin/recscript
   # $1 is the target directory

   cd $1
   chmod +x b # or whatever files in there 

   for entry in `ls` 
   do

     if [ -L $entry ] then
       #this is a linkfile so I dont follow
     elif [ -d $entry ] then

        $HOME/bin/recscript $entry
     else
        # regular file. do whatever you want. you can even put
        # the chmod here if it would be cumbersome above
     fi
   done
   
   #end script



ok so it may be a little brutish but it gets the job done (like removing core files, 
*.class files before archiving, and that sort). feel free to use it as you please.

ciao!


On Fri, 30 Nov 2001 16:54:54 +1100, Navin <[EMAIL PROTECTED]> wrote:

   Hello people
   
   I have a problem and am trying to fix something
   
   A directories I have on my /home/navin/apps/JBoss directory
   
   has entries of files and directories. Now some of these directories do not 
   have x in the permission. I do not know how they got stripped off or if they 
   were not present at all. I tried changing ownership to myself, changing 
   permissions with chmod +x to directories. It workds but not for 
   subdirectories. It is very cumbersome to go into each subdirectory and do a 
   chmod +x. And I do not want to do chmod -R +x * - for obvious reasons.
   
   Now I was trying to cook up a small script which would go into each directory 
   and do a chmod for me. For that I was trying to get 'ls -Rd' working but it 
   prints 
   
   ./ 
   
   only. I tried 'ls -Rd *' but it prints directories in the current directory 
   only. It does not recurse, i guess, since I gave -d.
   
   Can anyone please solve my problem with the chmod OR with the ls. 
   
   thanks a lot.
   
   regards
   navin
   
   
   


-- 

"Programming, an artform that fights back."

===============================

Anuerin G. Diaz
Design Engineer
25/F Equitable-PCI Tower
ADB Ave. cor. Poveda St.,
Ortigas Center, Pasig City,
Philippines 1605

Tel no: (632) 6383070 loc 75
===============================

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to