remove lines with keywords

In Subversion, they recommend not to use keyword replacement. The main reasons are that this can make merges more difficult. However, if you have a body of code, removing these keywords can be painful. Powerful linux command line tool can come to the rescue, specifically sed, the command line (streaming) editor.

For example,  to remove all lines in all java files which contain “$Id”

sed -i -e /\$Id/d `find . -name *.java`

Leave a Reply

Your email address will not be published. Required fields are marked *

question razz sad evil exclaim smile redface biggrin surprised eek confused cool lol mad twisted rolleyes wink idea arrow neutral cry mrgreen