bash

Posted by Jeet Sukumaran

This is pretty slick: enter "fc" in the shell and your last command opens up for editing in your default editor (as given by "$EDITOR"). Works perfectly with vi. The"$EDITOR" variable approach does not seem to work with BBEdit though, and you have to:

$ fc -e '/usr/bin/bbedit --wait'

With vi, ":cq" aborts execution of the command. Not sure how to do the same thing with BBEdit.

Posted by Jeet Sukumaran

Here are three confessions:

Grep a Glob

04 Oct 2008
Posted by Jeet Sukumaran

Ever wanted to search a group of files, as specified by a glob pattern, for some content, as specified by a grep pattern?

find -path '' -exec grep -iHn {} \;

Note that the GLOB-PATTERN should be quoted to prevent the shell from auto-expanding wildcards before passing them to find.

Examples:

find /Applications -path "*.app/Contents/Info.plist" -exec grep -iH python {} \;