Skip to content

Instantly share code, notes, and snippets.

@umiphos
Created April 3, 2019 00:04
Show Gist options
  • Save umiphos/54658fafa9d70d9f58363a5bb96fe208 to your computer and use it in GitHub Desktop.
Save umiphos/54658fafa9d70d9f58363a5bb96fe208 to your computer and use it in GitHub Desktop.
Used when we need to change a variable name with sh in a LOT of files at once
#!/bin/sh
grep -rl --exclude-dir=.git $1 |xargs sed -i 's/'$1'/'$2'/g'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment