I have been using sed
to strip CVS keywords from many, many files but I have encountered a case where multiple CVS keywords appear on the same line, for which a I do not have an adequate solution. For example, suppose the following line existed in a file:
$Revision: 1.2 $ $Date: 2015/01/06 17:14:53 $
Now I want the result to like:
$Revision$ $Date$
However, the sed command I have been using:
sed -i -e 's/\(\$Revision:\).*\( \$\)/\$Revision\$/'
finds the outter most fit to the search, which strips the Date keyword:
$Revision$
Without any assumptions on order (Revision and Date might be flipped) nor any assumptions of their line placement (cant assume beginning or end of line), how can I strip the keywords independently?