Whamcloud - gitweb
LUDOC-266 protocol: Initial content for new repository
[doc/protocol.git] / build / whitespace.sh
diff --git a/build/whitespace.sh b/build/whitespace.sh
new file mode 100755 (executable)
index 0000000..38a7360
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+# whitespace.sh
+# Remove whitespace at the end of lines. This could go directly in the
+# Makefile if suitably quoted, but getting the quoting just right is
+# both fussy and makes the action less readable.
+# [2015-01-23]
+# I needed to remove _all_ the space, not just the last instance.
+# -Andrew
+
+for file in $@
+do
+    echo "$file: "
+    sed -i.bak -E "s/[[:space:]]*$//" $file
+    diff $file ${file}.bak
+done
+