# exit - Exit the top csh script.
#
# Version 1.3
#
# Pre:
#    current_dir - directory to cd to before removing files
#    exit_files - list of temporary directories and files to be removed
#
# This routine is sourced from csh.
#
# Copyright (c) 1995 by
#
#    Confluent, Inc.
#    400 Spear St., Suite 207
#    San Francisco, CA 94105
#
# Voice: 415-764-1000
# Fax: 415-764-1008
# Internet: info@confluent.com
#
# Created: 950116 - jag
# Modified: 950827 - jag : Use "rm -r" to remove temporary directories
#                          cd to $current_dir before removing files
#                          Inform user that files are being removed

# cd to $current_dir if it is set.
if ($?current_dir) then
  cd $current_dir
endif

# Remove temporary directories and files if the list is defined.
if ($?exit_files) then
  echo ""
  echo "Removing temporary files and directories..."
  rm -rf $exit_files
endif

# Exec a nop command to exit without needing to unwind the source stack.
# $status is set to 0, as with exit(0).
exec sleep 0
