egrep without .svn matches polluting results (by using an inverted egrep)

If you use SVN for version control, you've probably run into situations where there are undesirable matches to your egrep command from resources within .svn directories. It's easy enough to avoid that by piping the output of your first egrep into a second that does an inverted search (ie. returns anything that does not match the expression):

egrep -rn 'hook_form_alter' . | egrep -v '\.svn'

It's the -v option that does the inverting.

No comments

Add your comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

Find Me Around

User login