MYSHELL XCOMM ACCESS1.CSH -- look for the first accessible executable XCOMM XCOMM initialize SAORD variables if ( $?SAORD_ROOT == 0 ) then setenv SAORD_ROOT HERE 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`" XCOMM end of SAORD initialization set last = "" set n = 1 while ("$n" <= "$#argv") set last = $argv[$n] set exe = `${SAORD_BIN}/access $argv[$n] x` if ( "$exe" != "" ) then echo "$exe" exit endif @ n++ end XCOMM didn't find anything -- return last and hope for the best echo "$last"