#!/bin/bash RM_FILES="last_msg.bak merge.debug merge.log" OTHER_RM_FILES="mails/* akpm-import.log" MV_FILES="summ" # check for files that should exist before we delete anything for i in ${RM_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