#!/bin/sh # fclean -- clean up framemaker backup files # # SYNOPSIS: Remove files whose names match *.backup.fm from # current working directory # Giving prefixes causes only files with names starting in that list # to be removed. # # AUTHOR: Gary T. Leavens fclean() { USAGE="Usage: $0 [prefix ...]" # no options allowed case "$1" in -*) echo "$USAGE" >&2 exit 2 ;; esac # all files if no prefix specified if test $# -eq 0 then set '*' fi # remove the files for p do rm -f ${p}.backup.fm done } [ -n "$echo" ] && set -x fclean "$@" exit 0