On Wed, 2010-11-24 at 23:40 +0200, Alexey Dobriyan wrote:
If this is really useful, perhaps it should be done treewide.
Here's a script that does that:
grep -rPl --include=*.[ch] "\bseq_printf\b" * |
xargs perl -p -i \
-e 's/\bseq_printf\s*\(\s*([^,]+),\s*\"([^\%\"]+)\"\s*\)/seq_puts\($1, \"$2\"\)/g'
grep -rPl --include=*.[ch] "\bseq_puts\b" * |
xargs perl -p -i \
-e "s/\bseq_puts\s*\(\s*([^,]+),\s*\"\\\n\"\s*\)/seq_putc\(\$1, '\\\n'\)/g"
grep -rPl --include=*.[ch] "\bseq_puts\b" * |
xargs perl -p -i \
-e "s/\bseq_puts\s*\(\s*([^,]+),\s*\"(.)\"\s*\)/seq_putc\(\$1, '\$2'\)/g"
$ git diff --shortstat
256 files changed, 1119 insertions(+), 1119 deletions(-)
--