8000 GitHub - unmonk/dirclean: file removal based on pattern without find
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

unmonk/dirclean

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PatternCleanupScript

Shell script which cleans up a directory by deleting files that match particular patterns.

##Usage## Make Executable:

chmod u+x dirclean

Run Script:

dirclean [--test] ROOT_DIRECTORY PATTERN... ##Logic##

  1. Error Check:
  • Program called w/ enough arguments, if not print usage message & failure exit status.
  1. Decode Args:
  • if --test specified, find ROOT_DIRECTORY`, get list of patterns.
  1. Validate ROOT_DIRECTORY:
  • if invalid, print err w/ failure status.
  1. Loop Root Directory Entries:
  • if entry regular file, determine if it matches PATTERN
  • if match, print message: state file being deleted, then delete it (rm FILENAME)
  1. On Success:
  • Return value of 0 (EXIT_SUCCESS)

About

file removal based on pattern without find

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages

0