Skip to content

Instantly share code, notes, and snippets.

@sagax
Last active March 1, 2016 19:25
Show Gist options
  • Save sagax/4c4d0cd2751b3f7c120e to your computer and use it in GitHub Desktop.
Save sagax/4c4d0cd2751b3f7c120e to your computer and use it in GitHub Desktop.
how to use shell variable in awk pattern
foo="bar"
awk "/$foo/"'{print $0}' some_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment