home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / ckscripts / delete < prev    next >
Text File  |  2020-01-01  |  873b  |  25 lines

  1. #!/usr/local/bin/kermit +
  2. #
  3. # d e l e t e
  4. #
  5. # This one barely qualifies as a script but it answers the Frequently
  6. # Asked Question: "How do I delete files that are more than 5 days old?"
  7. # /BEFORE is just one of many file-selection switches that can be used
  8. # on DELETE, DIRECTORY, SEND, PURGE, and other file-related commands.
  9. # Date switches such as /BEFORE: and /AFTER: can take not only absolute
  10. # dates and/or times in various formats (such as "8-Feb-1999_10:28:30")
  11. # but also relative ones like "-5Days", "+3months", etc.  Other file
  12. # selection switches include /LARGER-THAN:size, /SMALLER-THAN:size,
  13. # /EXCEPT:pattern, etc.
  14. #
  15. if > \v(argc) 2 {
  16.     echo
  17.     echo { Please quote wildcards on the command line.}
  18.     echo { I need to expand wildcards myself.}
  19.     echo
  20.     exit 1
  21. }
  22. if not def \%1 { exit 1 delete what?}
  23. delete /list /before:-5days \%1
  24. exit \v(status)
  25.