android enable log in all the C++ files
Posted: Sat Apr 11, 2015 2:38 am
find all the cpp files and, for each file, if it contains "//#define LOG_NDEBUG 0" , replace it with "#define LOG_NDEBUG 0" removing the //
NB: the // have to be escaped into \/\/
The expression:
is like any normal string replacement in vi:
:1,% s/needle/haystack/g
Code: Select all
find . -name *.cpp | xargs grep "\/\/#define LOG_NDEBUG 0" -l | xargs sed -i "s/\/\/#define LOG_NDEBUG 0/#define LOG_NDEBUG 0/g"
NB: the // have to be escaped into \/\/
The expression:
Code: Select all
"s/\/\/#define LOG_NDEBUG 0/#define LOG_NDEBUG 0/g"
is like any normal string replacement in vi:
:1,% s/needle/haystack/g