mrproper.csh 974 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/csh
  2. if ($#argv == 0) then
  3. goto help_lbl
  4. exit
  5. endif
  6. set dir = ""
  7. foreach arg ($argv)
  8. @ counter++
  9. if ("$arg" == "-d") then
  10. @ counter++
  11. set dir = $argv[$counter]
  12. break
  13. endif
  14. end
  15. if ("$dir" == "") goto help_lbl
  16. echo -n "Cleaning $dir directory... "
  17. foreach arg ($argv)
  18. switch ($arg)
  19. case -f | --f19:
  20. find $dir -name "*.f19" -delete
  21. breaksw
  22. case -r | --root:
  23. find $dir -name "*.root" -delete
  24. breaksw
  25. endsw
  26. end
  27. find $dir -name "sched*" -delete
  28. find $dir -name "*.out" -delete
  29. find $dir -name "*.err" -delete
  30. find $dir -name "*.session.xml" -delete
  31. echo "Done"
  32. exit
  33. #########################
  34. #### Help procedure #####
  35. #########################
  36. help_lbl:
  37. echo "--== MrProper clean your folder ==--"
  38. echo " How to properly use MrProper:"
  39. echo " 1) mrproper directory"
  40. echo " 2) just turn'em on and watch how fast he "
  41. echo " cleans your directory from .root, .out and even .err files!"