#!/bin/sh # # ---------- # AiresCheck # ---------- # # This is a sh script to invoke Aires with the CheckOnly flag enabled, # in order to check a given input file. # # Written by S. J. Sciutto, La Plata 1996, 1997, 1998, 2003. # # Last modification: 14/Apr/2003. # # # Usage: # # AiresCheck [-tP] [-p program] input_file_name # # ############################################################################### # # Setting predefinded constants. # AiresSet="${HOME}/.airesrc" if [ -f $AiresSet ] then . $AiresSet else # # .airesrc file does not exist, trying in default bin directory. # AiresSet="${HOME}/aires/current/bin/airesrc" if [ -f $AiresSet ] then . $AiresSet else # # Have no other ideas about the setting file. # echo echo Cannot find internal script file! echo exit fi fi . ${Airesbindir}/AiresSetParams # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Analysing the input parameters. # trace= pipe="$FileBrowser" prog="$tprogram" nprog= # for arg in $*; do # case "_$arg" in # _-t) trace=ON shift ;; _-p) nprog=TRUE shift ;; _-P) pipe="$PrintCommand" shift ;; _-tP|_-Pt) trace=ON pipe="$PrintCommand" shift ;; _-tp) trace=ON nprog=TRUE shift ;; _-Pp) pipe="$PrintCommand" nprog=TRUE shift ;; _-tPp|_-Ptp) trace=ON pipe="$PrintCommand" nprog=TRUE shift ;; _-*|_) echo Usage: AiresCheck [-tP] [-p program] input_file_name exit ;; *) if [ $nprog ] then prog="$arg" shift nprog= fi ;; esac done # if [ "_$1" = "_" ] then echo Usage: AiresCheck [-tP] [-p program] input_file_name exit else file="$1" fi case $prog in /*) if [ ! -x $prog ] then echo AiresCheck: ${prog}: Program not found exit fi ;; *) if [ ! -x $prog ] then if [ -x ${Airesbindir}/$prog ] then prog="${Airesbindir}/$prog" else echo AiresCheck: ${prog},${Airesbindir}/${prog}: Programs not found exit fi fi ;; esac goon= if [ -f $file ] then goon=TRUE else file="${file}.inp" if [ -f $file ] then goon=TRUE fi fi if [ $goon ] then if [ $trace ] then $prog << EoD1 | $pipe StopOnError Off Trace On Input $file Trace Off CheckOnly End EoD1 else $prog << EoD2 | $pipe StopOnError Off Trace Off Input $file Trace Off CheckOnly End EoD2 fi else echo AiresCheck: Input file not found. fi exit # # This script file is part of the AIRES Runner System; # AIRES 2.8.4a distribution. # # xxx 0 Tue Dec 12 16:28:05 ART 2006