Added the script to fix the file suffix
authorJoey Schulze <joey@infodrom.org>
Tue, 12 Aug 2003 13:04:49 +0000 (13:04 +0000)
committerJoey Schulze <joey@infodrom.org>
Tue, 12 Aug 2003 13:04:49 +0000 (13:04 +0000)
bin/fixsuffix [new file with mode: 0755]

diff --git a/bin/fixsuffix b/bin/fixsuffix
new file mode 100755 (executable)
index 0000000..e639d8b
--- /dev/null
@@ -0,0 +1,24 @@
+#! /bin/bash
+
+# Fixes file suffix
+#
+# .html -> .shtml
+#   Require "<!--#include"
+#
+# .html -> .php3
+#   Require "<?"
+
+for f in $*
+do
+    if grep -q '<!--[ ]*#include' $f
+    then
+       base=${f%.html}
+       mv -f $f $base.shtml
+    else
+        if grep -q '<?' $f
+       then
+           base=${f%.html}
+           mv -f $f $base.php3
+       fi
+    fi
+done