Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=yaxmenu.git;a=commitdiff;h=6260a67552f58fd2ce3ed4b7f82ba88af6c0f76d

commit 6260a67552f58fd2ce3ed4b7f82ba88af6c0f76d
Author: James Buren <r...@frugalware.org>
Date:   Wed Dec 2 23:28:19 2009 -0600

clean-file.bash
* initial draft

diff --git a/tools/clean-file.bash b/tools/clean-file.bash
new file mode 100755
index 0000000..61adc0d
--- /dev/null
+++ b/tools/clean-file.bash
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+if [ -z "${1}" ]; then
+  echo "Usage: ${0} <file>"
+  exit 1
+fi
+
+if [ ! -f "${1}" ]; then
+  echo "${1} does not exist or is not a regular file."
+  exit 1
+fi
+
+sed -i "s|\s*$||" "${1}" &> "/dev/null"
+
+echo "w" | ed -s "${1}"  &> "/dev/null"
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to