Today at work I had to list all the "SELECT INTO" request our application can make. I'm talking about hundreds and hundreds of files. A simple grep won't be enough, because the request is usually written over 5 to 10 lines.
Impulsive as usual, I open Vim and write
#!/usr/bin/python
I start thinking about my script. Reading the file is easy, python is great.
But as always, Unix slaps you in the face and gives you a definite reminder of how awesome it truly is. Turns out grep has an option that does that!
So that task that could've taken a couple hours to script (and months to do by point and click), was reduced to this simple command
$ find . -type f | xargs grep -A 10 "SELECT INTO" > queries.list
One thing I love about the command line is how easy it makes it to formulate your ideas