Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recursively deleting in subdirectories with csh

Status
Not open for further replies.

bigssa

Technical User
Jan 17, 2005
9
US
Hey,
I need to delete all *.pyc files in a folder and its subdirectories in a csh script. I am currently trying to do it with a foreach loop:
foreach f ( 'find ../cadcore "*.pyc"' )
rm -f $f
end
Any ideas would be appriciated

Thanks
-bigssa
 
Why not simply using the find command ?
find /path/to/dir -name '*.pyc' | xargs rm -f

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thank you very much. That helped greatly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top