#!/bin/tcsh -f
# xpa_replace -- replace an extension and send file via XPA
# Eric Mandel 9/24/92
#

# initialize SAORD variables
if ( $?SAORD_ROOT == 0 ) then
  setenv SAORD_ROOT /scisoft/saord
endif
if ( -e ${SAORD_ROOT}/xpa1 ) then
  setenv XPA_VERSION 1
else
  setenv XPA_VERSION 2
endif
if ( $?SAORD_BIN == 0 ) then
  setenv SAORD_BIN ${SAORD_ROOT}/bin.`${SAORD_ROOT}/getarch`
endif
if ( $?SAORD_TMPDIR == 0 ) then
  setenv SAORD_TMPDIR /tmp
endif
setenv SAORD_VERSION "`cat ${SAORD_ROOT}/VERSION`"
# end of SAORD initialization

set root = $argv[1]
set root = $root:r;
echo file ${root}$argv[2] | ${SAORD_BIN}/xpaset $argv[3]
