svn commit: trunk/busybox/scripts

vda at busybox.net vda at busybox.net
Sun Apr 8 08:12:21 PDT 2007


Author: vda
Date: 2007-04-08 08:12:21 -0700 (Sun, 08 Apr 2007)
New Revision: 18365

Log:
adding small script, mostly for documentational purposes


Added:
   trunk/busybox/scripts/cleanup_printf2puts


Changeset:
Added: trunk/busybox/scripts/cleanup_printf2puts
===================================================================
--- trunk/busybox/scripts/cleanup_printf2puts	                        (rev 0)
+++ trunk/busybox/scripts/cleanup_printf2puts	2007-04-08 15:12:21 UTC (rev 18365)
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# Processes current directory recursively:
+# printf("abc\n") -> puts("abc"). Beware of fprintf etc...
+
+# BTW, gcc 4.1.2 already does tha same! Can't believe it...
+
+grep -lr 'printf\([^%%]*\\n"\)' . | grep '.[ch]$' | xargs -n1 \
+    sed -e 's/\([^A-Za-z0-9_]\)printf(\( *"[^%]*\)\\n")/\1puts(\2")/' -i


Property changes on: trunk/busybox/scripts/cleanup_printf2puts
___________________________________________________________________
Name: svn:executable
   + *



More information about the busybox-cvs mailing list