SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Sep 2002
    Posts
    225
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Shell Script Question

    Anyone know how to write a quick script that would delete a directory if it only has .svn (which is a directory) inside it and no other files or directories?

    thanks!

  2. #2
    SitePoint Addict
    Join Date
    Sep 2002
    Posts
    225
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For anyone who is curious I found a way to do this.

    Code:
    $ find /path/to/source/dir -type d > source_dirs
    $ find /path/to/target/dir -type d | grep -v ".svn" > target_dirs
    $ diff source_dirs target_dirs
    Last edited by paulsjv; Jun 6, 2008 at 07:56.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •