On 2 March 2010 14:55, Aaen, Andreas.Bach
<[email protected]> wrote:
> Actually I would like to build a litte more complex rule:
> ---------------
> @@
> @@
> -RELEASESTR("$Id:$");
> @r@
> @@
> #include <std.h>
> +RELEASESTR("$Id:$");
> -----------------
>
> So that I am sure that there only is one RELEASESTR in each file and that
> it's lpacved
> right after #include <std.h>
Withouth intending to destroy the fun of trying to make coccinelle
do the job, I guess that
perl -ni -e 'print unless /RELEASESTR\(.*\);/; print
"RELEASESTR(\"\$Id:\$\");\n" if /#include <std.h>/;' *.c
would work as well?
BR Håkon Løvdal
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)