Skip to content

Instantly share code, notes, and snippets.

@SyntaxStacks
Created April 25, 2014 17:33
Show Gist options
  • Save SyntaxStacks/11297228 to your computer and use it in GitHub Desktop.
Save SyntaxStacks/11297228 to your computer and use it in GitHub Desktop.
function sedReplace () {
if [ -z "$1" ] || [ -z "$2" ]
then
echo "\nUsage: sedReplace <path> <sed_string>\nsedString example: \"s/replace_this/with_that/g\"\n"
return 1
fi
eval "find $1 -type f -exec sed -i '' '$2' {} \;"
return 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment