#!/bin/sh
#
#  delete a miriad image
#
# $Source: /u/vmcintyr/shellscripts/miriad/backward.sh,v $
# $Date: 2001/09/21 07:04:49 $
#
if [ $# -eq 0 ]; then
  echo "Usage: `basename $0` <image>"
  exit 1
fi

while [ $# -gt 0 ];
do
  img=$1;

  if [ ! -d "$img" ]; then
       echo "Can't find image $img, exiting";
       exit 1
  else
   if [ -f "${img}/header" -a -f "${img}/image" -a -f "${img}/history" ]; then
     /bin/rm -rf "${img}"
   else
     echo "This doesn't look like a miriad image. Skipping."; exit 0
   fi
  fi
  shift;
done

echo "Task complete"
exit 0
