#!/bin/csh #======================================================================* # duat -- connect to DUATS and save briefing session log in a file # # syntax: duat [options] [logfile] # # If you don't name a log file the session will be copied to the file # duat.log. All "--More--" lines will be removed, and CR-LF at the end # of a line is changed to just LF. # # Options: -s if you are a Student Pilot (duats.gtefsd.com) # -v to watch what the script is doing # # by Eric Myers 4 March 1991 # with suggestions by Barney Lum (barney@sol.usc.edu) # @(#) $Revision: 1.11 $ $Date: 1999/07/26 19:31:01 $ #======================================================================* # (Initial) Parameters: set DUATHOST="duat.gtefsd.com" # for pilots only set LOG=duat.log # default log file name set TMP=/tmp/duat.$$ # tmp file for cleaning log # Parse command line options: -s, -v or logfile name while ( $#argv ) switch ($1) case -s: set DUATHOST="duats.gtefsd.com" ; breaksw case -v: set echo ; breaksw default: set LOG="$1" endsw shift end # If you have trouble with the date command below just remove or modify. # It's not that important now that Contel put a similar date stamp in # their session. echo " " echo "NOTE: Current Zulu Time: " `date -u "+%T"` echo " " # telnet to the host and save a copy of sesion in TMP file echo telnet ${DUATHOST} ... telnet ${DUATHOST} | tee ${TMP} # When done, get rid of "--More--" at begining of a line and ^M at end grep -v "^--More--" ${TMP} | tr -d "\015" > $LOG # get rid of the TMP log file rm ${TMP} echo "DUAT session saved in the file $LOG" exit 0