Skip to content

Instantly share code, notes, and snippets.

@playmono
Created March 26, 2018 13:43
Show Gist options
  • Save playmono/1e9d46709afbee48126bda1e785511f8 to your computer and use it in GitHub Desktop.
Save playmono/1e9d46709afbee48126bda1e785511f8 to your computer and use it in GitHub Desktop.
super grep function for bash
# sgrep php 'helloworldinphp'
# sgrep js 'helloworldinjs
sgrep() {
length=$(($#-2))
parameters=${@:1:$length}
beforelast=$(($#-1))
grep -nr --color $parameters "${!#}" --include=*."${!beforelast}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment