#!/bin/csh
# This script is called by ACEDB Pick_me_to_call records.
# It copies the file to a temporary file in the current working directory, 
# and then runs the appropriate viewer. After viewing, the 
# temporary file is deleted.  
# $ACE_XEditor is the name of the program. 
# $1 is the file for the program to use.

# RM_CMD - command to be used for removing files and directories
if (-e /usr/bin/rm) then
   set RM_CMD = /usr/bin/rm
else
   if (-e /bin/rm) then
      set RM_CMD = /bin/rm
   else
      set RM_CMD = rm
   endif
endif

#echo Copying $1

set tempfile = acedb_$$
cp $1 ./$tempfile

#ls -l ./$tempfile

($ACE_XEditor $tempfile; $RM_CMD -f $tempfile) &