Script for recoded files conversion
authorslubek <slubek>
Thu, 11 Dec 2003 23:36:03 +0000 (23:36 +0000)
committerslubek <slubek>
Thu, 11 Dec 2003 23:36:03 +0000 (23:36 +0000)
lang/convert.awk [new file with mode: 0755]

diff --git a/lang/convert.awk b/lang/convert.awk
new file mode 100755 (executable)
index 0000000..dc684d4
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/awk -f
+#
+# Script contains all needed conversions of recoded text
+#
+# Remove everything before first "<?php"
+BEGIN  { while (index($0,"&lt;?php")==0) { getline; continue } 
+         print "<?php";
+       }
+# Remove everything after first "?>"
+# (as there should be only one occurance, thats no problem)
+/\?\&gt;/ { print "?>"; exit }
+
+       { # I'm not sure if its still needed
+         gsub("&gt;",">"); 
+         gsub("&lt;","<"); 
+         # Convert CRLF -> LF (== "remove CR" ) ;-)
+         gsub("&#13;","");
+         print $0
+       }