Created
January 28, 2011 21:46
-
-
Save allthingscode/801050 to your computer and use it in GitHub Desktop.
This script is an exact alias to egrep except that instead of printing out the files, it opens them in VIM sequentially.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
shopt -s -o nounset # Option Explicit | |
# ============================================================================= | |
for ITEM in `egrep -l $* 2> /dev/null | sed -e 's/ /[SPACE]/g'` ; do | |
# unescape spaces | |
declare FILEPATH | |
FILEPATH=`echo $ITEM | sed -e 's/\[SPACE\]/ /g' -e 's/\n//g'` | |
vim $FILEPATH | |
done | |
exit 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment