I recently had a Subversion working copy with several files that were modified because they should not have been under source control to begin with. I had to find all the modified *.Plo files and remove the folders that contained them. I ended up using this, which is the longest pipeline I can remember using:
svn st|grep '^M.*Plo$'|awk '{print $2}'|xargs -n 1 dirname|uniq|xargs svn rm --force
To break it down:
- svn st: List all local changes
- grep ‘^M.*Plo$’: Find modified *.Plo files
- awk ‘{print $2}’: Strip off the “M” (modified) flag
- xargs -n 1 dirname: Find the directory name of each file
- uniq: Remove duplicates
- xargs svn rm –force: Remove the folders
Since the folders containing the *.Plo files were all named .deps, I could’ve accomplished the same thing with this, but I didn’t think of it until after:
find -name .deps|xargs svn rm --force
Anyway, yay pipelines!