MYSHELL XCOMM XCOMM wwwtng -- script to access files over the Web and feed them to SAOtng XCOMM XCOMM Eric Mandel 3/20/98 XCOMM unalias rm mv XCOMM check required arguments if ( "$#argv" < 1 ) then echo "ERROR: no WWW file specified" exit(1) endif 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 wwwname=$argv[1] set filename=${wwwname:t} set extn=${filename:e} set tname=${SAORD_TMPDIR}/twwwtng_$filename set oname=${SAORD_TMPDIR}/wwwtng_$filename if ( -e $oname ) then goto got endif set cmd=`${SAORD_BIN}/access lynx x` if( "$cmd" == "" ) then echo "ERROR: can't find 'lynx' to access WWW file: $wwwname" exit(1) endif rm -f $tname $cmd -source $wwwname > $tname if (! -e $tname ) then echo "ERROR: could not retrieve WWW file: $wwwname" exit(1) endif if ( -z $tname ) then echo "ERROR: zero length WWW file: $wwwname" rm -f $tname exit(1) endif mv $tname $oname got: if( "$extn" == "Z" ) then unziptng $oname else if( "$extn" == "gz" ) then unziptng $oname else cat $oname endif