Skip to content

Instantly share code, notes, and snippets.

@gregohardy
Last active March 19, 2020 10:50
Show Gist options
  • Save gregohardy/a726763b8ae6fe9c3d08cf352979c79b to your computer and use it in GitHub Desktop.
Save gregohardy/a726763b8ae6fe9c3d08cf352979c79b to your computer and use it in GitHub Desktop.
Find and replace uri's recursively with sed
grep -rl '/utils' ./ | xargs gsed -i "s+/utils+/lib/utils+g"
@gregohardy
Copy link
Author

gregohardy commented Mar 19, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment