Skip to content

Instantly share code, notes, and snippets.

@plantarum
Created February 27, 2017 22:15
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 plantarum/80937e21cde1f51764ee3727f92a50a6 to your computer and use it in GitHub Desktop.
Save plantarum/80937e21cde1f51764ee3727f92a50a6 to your computer and use it in GitHub Desktop.
loop over regexes to exclude them from a file
## make a copy of the original file that we can modify
cp original_data outfile
## loop over a file of regexs, applying each to our output
while read rx; do
grep -v $rx outfile > outfile.tmp
mv outfile.tmp outfile
done < regex_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment