Skip to content

Instantly share code, notes, and snippets.

@ofZach
Created April 1, 2014 00:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ofZach/9905458 to your computer and use it in GitHub Desktop.
Save ofZach/9905458 to your computer and use it in GitHub Desktop.
rename testApp to ofApp
# rename files:
find . -type f -iname "testApp.h" -exec rename 's/testApp/ofApp/' {} \;
find . -type f -iname "testApp.cpp" -exec rename 's/testApp/ofApp/' {} \;
#find and replace
find . -type f -iname "ofApp.h" -exec sed -i "" 's/testApp/ofApp/g' {} \;
find . -type f -iname "ofApp.cpp" -exec sed -i "" 's/testApp/ofApp/g' {} \;
find . -type f -iname "main.cpp" -exec sed -i "" 's/testApp/ofApp/g' {} \;
@kylemcdonald
Copy link

do you think this works in cygwin? maybe we should tweet it from @openframeworks.

@ofZach
Copy link
Author

ofZach commented Apr 1, 2014

I am not sure this is cross platform -- for example, this is definitely something I needed for osx: -exec sed -i ""

as per michaeljones/sphinx-to-github#1

I think a more cross platform approach would potentially be a python script. I'll take a look at this shortly.

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