View Single Post

  #5 (permalink)  
Old 03-12-2005, 02:21 PM
Gopal Gopal is offline
Junior Member
User
 
Join Date: Feb 2005
Location: Punjab
Posts: 6
Rep Power: 0
Gopal
Default solution

Hi,

try these lines

Code:
#!/bin/bash
for name in `tree -ifp | grep "\[-..x" | tr -s " " | cut -d " " -f2`
do
rm $name
done
Quote:
tree -ifp
will give you list of all dirs recursively including all subdirectories with FAP and relative pathname

Quote:
grep "\[-..x"
will fetch only executable files from FAP with relative pathname

Quote:
tr -s " "
will squeeze the space between the two columns i.e. FAP and path to file.

Quote:
cut -d " " -f2
will fetch the second column i.e. relative path and filename.

these filenames with relative pathname are saved in
Quote:
name
variable and then the
Quote:
rm
command removes those file.

Try and see..

Gopal
Reply With Quote