Created
September 18, 2020 20:08
-
-
Save noahbliss/708af359fd8ef34703d93e294d3c03b3 to your computer and use it in GitHub Desktop.
Sed wizardry to extract regex from standard in or a file as arg 2.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sed -nE "s#.*($1).*#\1#p" "$2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment