This bad boy takes 3 arguments:
- Regular Expression (no spaces . . . or bounded by double quotes)
- Direcory to search on
- Ouput file
#!/bin/bash
###############################################
## grepSVN.sh
## Script that grep -r a directory and removes all unwanted mateches
## (svn and binary swap files, and also compiled smarty templates)
##
## Author: Matthew Story
## Date: 10/31/2007
## All Contents Released Under the LGPL v1.0
###############################################
grep -r ${1} ${2} | sed s/^.*[.]svn.*$//g | sed s/^Binary[[:space:]]*file.*$//g | sed s/^.*templates_c.*$//g > ${3}
vim -c "%s/^$\n//g" ${3}
No comments:
Post a Comment