Skip to content

Instantly share code, notes, and snippets.

@h3xh4wk
Last active January 10, 2017 11:54
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 h3xh4wk/652d436bdbbcd802ee592eb707a2d7ea to your computer and use it in GitHub Desktop.
Save h3xh4wk/652d436bdbbcd802ee592eb707a2d7ea to your computer and use it in GitHub Desktop.
# inline substitution based on condtion using regexp match processing all lines in a given file<filename>
# Note: Don't know why this wasn't working in git bash but worked when used Console2 + git bash
perl -pn -i'.bkup' -e 's/toreplace/replacewith/ if /regex/' filename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment