A usage of sed

sed will update modify time for all the files being accessed for running sed -i '/pattern/replacement/g' . The solution is to use grep and xargs. For example, the following command replaces INVOKEPYTHON_API with INVOKEJAQL_API in all the files in the current directory and its descendent directories. Only files which has been updated will have modify time changed.

 

grep -R -l INVOKEPYTHON_API . | xargs sed -i 's/INVOKEPYTHON_API/INVOKEJAQL_API/g'

你可能感兴趣的:(sed)