android enable log in all the C++ files

fabiodelorenzo
Posts: 65
Joined: Thu Oct 03, 2013 5:54 pm

android enable log in all the C++ files

Postby fabiodelorenzo » 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 //

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

Return to “AOSP”

Who is online

Users browsing this forum: No registered users and 0 guests