Created
September 10, 2014 19:05
-
-
Save inhumantsar/42707c9598bc993243b5 to your computer and use it in GitHub Desktop.
Extract substring from grep matches
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
grep openvpn::client dev.pp | sed -e "s/\s*openvpn::client\s*{ '\([a-zA-Z]*\)':/\"\1\",/g" | |
takes | |
openvpn::client { 'serged': | |
openvpn::client { 'danielc': | |
openvpn::client { 'nigelg': | |
and converts it to | |
"serged", | |
"danielc", | |
"nigelg", |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment