#!/bin/sh
#
# This script is part of the XAPRTOOLS suite of program - 
# a subset of FreeUSP - the UNIX Seismic Processing system.
#

XAPRTOOLS_AUDIT=${USP_AUDIT:="false"}
XAPRTOOLS_AUDIT_FILE=${USP_AUDIT_FILE:="/tmp/.usp-audit"}

. xaprtools-set-env

. usp-generic-set-path

if test ${XAPRTOOLS_AUDIT:-"not set"} != "false" 
then
  touch ${XAPRTOOLS_AUDIT_FILE} > /dev/null 2>&1
  test -w ${XAPRTOOLS_AUDIT_FILE} &&  \
#   echo XAPRTOOLS `uname -n` ${USER} `date +"%H:%M:%S %m/%d/%y"` ${APP} | /bin/awk '{printf("%10s : %10s : %6s : %s %s : %s\n",$1,$2,$3,$4,$5,$6)}' >> ${XAPRTOOLS_AUDIT_FILE}
  ( echo XAPRTOOLS `uname -n -s -r` ${USER} `date +"%H:%M:%S %m/%d/%y"` ${APP} | awk '{printf("%3s : %s(%s/%s) : %6s : %s %s : %s\n",$1,$3,$2,$4,$5,$6,$7,$8)}' >> ${XAPRTOOLS_AUDIT_FILE} ) > /dev/null 2>&1 & 
fi
