]> git.ozlabs.org Git - next-scripts/commitdiff
do_clean: create to save some typing/forgetting
authorStephen Rothwell <sfr@canb.auug.org.au>
Thu, 19 Apr 2018 03:59:47 +0000 (13:59 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 19 Apr 2018 03:59:47 +0000 (13:59 +1000)
do_clean [new file with mode: 0644]

diff --git a/do_clean b/do_clean
new file mode 100644 (file)
index 0000000..d6f97e5
--- /dev/null
+++ b/do_clean
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+RM_FILES="last_msg.bak merge.debug merge.log quilt-import.log"
+OTHER_RM_FILES="mails/*"
+MV_FILES="summ"
+
+# check for files that should exist before we delete anything
+for i in ${FILES} ${MV_FILES}; do
+       [ -e "$i" ] || {
+               printf '%s: no "%s" file\n' "$0" "$i" 1>&2
+               exit 1
+       }
+done
+
+echo rm ${RM_FILES} ${OTHER_RM_FILES}
+rm ${RM_FILES} ${OTHER_RM_FILES}
+
+for i in ${MV_FILES}; do
+       echo mv ${i}{,.old}
+       mv ${i}{,.old}
+done