From bcd17d0a39e91a02307048ddef95119efddb8a72 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Thu, 19 Apr 2018 13:59:47 +1000 Subject: [PATCH] do_clean: create to save some typing/forgetting --- do_clean | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 do_clean diff --git a/do_clean b/do_clean new file mode 100644 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 -- 2.39.2