# !/bin/ksh
#
# tapedumprm.ksh
# version 0
# Gary L. Armstrong -- 06-30-00
#
# A script to remove those pesky device dumps no one knows how to read.

version=0

tdarg=$1
erasure=0

help () {       # function intended to help
        print " "
        print "Script tapedumprm.ksh"
        print "Usage for version $version:"
        print "tapedumprm.ksh { erase | check | help }\n"
        print "erase will erase all dumps."
        print "check will look for dumps and report back."
        print "help will print this.\n"
        print "For example:"
        print "erase help"
}

checkarg () {   # function to do The Deed

        case $tdarg in
                erase )
                        rm /var/adm/ras/Atape.rmt?.dump*
                        erasure=1
                        ;;
                check )
                        ls -l /var/adm/ras/Atape.rmt?.dump*
                        ;;
                help )
                        help
                        ;;
                * )
                        print "Invalid argument"
                        print "Args: { erase | check | help }"
        esac
}

#main
checkarg
if [[ $erasure = 1 ]]; then
        print "Files erased"
else print "No files erased"
fi