Skip to content

Instantly share code, notes, and snippets.

@lloiacono
Created November 29, 2018 13:56
Show Gist options
  • Save lloiacono/0c2f46ed9e87e3ee9b088bc6ef643ab0 to your computer and use it in GitHub Desktop.
Save lloiacono/0c2f46ed9e87e3ee9b088bc6ef643ab0 to your computer and use it in GitHub Desktop.
Find first occurrence of STRING before search STRING
awk '/company_id/ {search_string=$0} /empty_before_import": true/ {print search_string FILENAME " " NR}' error_queue.*.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment