Skip to content

Instantly share code, notes, and snippets.

@PierrickKoch
Created January 16, 2013 10:16
Show Gist options
  • Select an option

  • Save PierrickKoch/4546130 to your computer and use it in GitHub Desktop.

Select an option

Save PierrickKoch/4546130 to your computer and use it in GitHub Desktop.
replace in code and doc
#!/bin/bash
STR_ORIG="_blendobj"
STR_REPL="_blender_object"
files=$(grep -rlF "${STR_ORIG}" . --include=*.{py,rst} --exclude-dir="build" --exclude-dir=".git")
# --exclude="${0}" --exclude="*.pyc" --exclude="*.blend"
for f in $files; do
sed -i "s/${STR_ORIG}/${STR_REPL}/g" $f
done
echo "done"
grep "${STR_ORIG}" . -lr --exclude="*.pyc" --exclude-dir="build" --exclude-dir=".git"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment