Last active
December 2, 2019 20:51
-
-
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
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
# 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