Skip to content

Instantly share code, notes, and snippets.

@donwilson
Created July 10, 2018 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donwilson/502b2f3b65e273a633c9454c689b48ac to your computer and use it in GitHub Desktop.
Save donwilson/502b2f3b65e273a633c9454c689b48ac to your computer and use it in GitHub Desktop.
Grep and ignore _old/ and *CST$ files
#!/bin/bash
CWD=$(pwd)
ARROW="-"
echo ""
echo "===================================="
echo "== Finding: $1"
echo "== - in: $CWD/"
echo "== - skipping paths that match '_old/|CST$'"
echo "=="
#working: ack --color --sort-files --match "$1" "$CWD"
ack -v -g '_old/|CST$' "$CWD" | ack --color --sort-files --match "$1" -x
#grep --color -E -nr '$1' . | grep --color -E '|$'
echo "=="
echo "===================================="
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment