Sometimes, it is nice to have a full script to check for something across your codebase. For instance, when you are on windows, or you are in a toolsmith role and have a team of non technical people to support. Other times though, you can just revel in the power of unix.

adam@feisty$ find . -name "*.pm" -exec grep -i -f dev_patterns.txt -H -n {} \\; > dev_notes.txt

does more or less the same thing as my developer notes script.

As a bit of explanation, what this does is…

  • Search (find)
  • Starting in the current directory (.)
  • every perl module (*.pm)
  • Once found, do a case insensitive search (-i)
  • For each of the patterns in dev_patterns.txt (-f)
  • And display the file name (-H)
  • And line number (-n)
  • And pump the output to a file (>dev_notes.txt)

Depending on your variant of unix, your flags might vary.