Last active
March 19, 2020 10:50
-
-
Save gregohardy/a726763b8ae6fe9c3d08cf352979c79b to your computer and use it in GitHub Desktop.
Find and replace uri's recursively with sed
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 -rl '/utils' ./ | xargs gsed -i "s+/utils+/lib/utils+g" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The + symbols replace the normal / delimiters for substitutions. This avoids the escaping fiasco for uri /'s.
**Warning : For macos **
brew install gnu-sed
For *nix : sed should work grand.