View Single Post
  #6   (View Single Post)  
Old 3rd January 2012
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

I should also point out that my little untested script doesn't use /bin/rm, and it should. It will also fail on any files that can't be rm'ed due to to permissions or immutability settings. It also doesn't test the cd; if that fails you could be clearing out the wrong directory.

I would think find(1) piped through xargs(1) for rm(1) would be a better way of managing the deletions. No need to even use cd(1).

No bourne shell handy today for testing any of these ideas, though.
Reply With Quote