#!/bin/sh
#
# RemoveBackupFiles
# Bourne shell script, should work on any Unix-based platform
#
# Recursively renames all *.backup files to their original names
# (the part before ".backup").  For example, to clean out backup
# files created by the ChangeURL script after you have verified
# that the updated files are correct.
#
# Install this file in any directory in your PATH (or any other
# directory, if you don't mind invoking it by specific pathname).
# Give it execute permission:
#
#   cd (directory where you saved this this)
#   chmod +x RemoveBackupFiles
#
# To run, cd to the directory where the "*.backup" files are
# (which can be a flat directory or the root of a directory tree)
# and then type:
#
#   RemoveBackupFiles
#
# Author: Frank da Cruz, 4 June 2017
#
for i in `find . -name \*.backup -print`; do
   echo -n $i...
   rm -f $i || exit 1
   echo "[ok]"
done
exit
