Skip to content

Instantly share code, notes, and snippets.

@leobrines
Last active December 2, 2019 20:51
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 leobrines/8a9fa09e2057f8927743eb1eeba12067 to your computer and use it in GitHub Desktop.
Save leobrines/8a9fa09e2057f8927743eb1eeba12067 to your computer and use it in GitHub Desktop.
Syntax for refactor with new lines and multiple files in Mac OS with sed command
# Source: https://unix.stackexchange.com/questions/26284/how-can-i-use-sed-to-replace-a-multi-line-string
sed -e '1h;2,$H;$!d;g' -e 's/__YOUR_REGEX_GOES_HERE__...'
# Source: https://blog.stathat.com/2012/10/11/refactoring_with_sed.html
sed -i "" 's/uc.User.Data.ApiKey/uc.User.ApiKey()/g' **/*.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment