FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

This script is an exact alias to egrep except that instead of printing out the files, it opens them in VIM sequentially. · GitHub

Instantly share code, notes, and snippets.

Created January 28, 2011 21:46
Show Gist options
  • Select an option

    Clone this repository at <script src="https://gist.github.com/allthingscode/801050.js"></script>
  • Save allthingscode/801050 to your computer and use it in GitHub Desktop.

Select an option

Clone this repository at <script src="https://gist.github.com/allthingscode/801050.js"></script>
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 hidden or 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

Back | FazBrowse Home | New Git URL