#!/bin/csh -f ############################################################################# # Copyright: J.Brewer/ESO 1999.############################################## ############################################################################# # # Name: ObsLog.prt # Description: This script will print the catalogue generated # by either ObsLogD, ObsLogT, or ObsLogN. At the moment an a2ps # command is used, and in the future a LaTeX may be implemented. # # # Author: James Brewer, jbrewer@eso.org # Version: 1.0, 5 May99: First release # ############################################################################# # # Check script arguments... # if($#argv != 0) then goto error endif # # Set variables... # set printer = -dlpt1d5 # N.B. -Pname: SunOS, "-d name": HP set catalog = ObsLog.out # Name of catalogue file... # # Ask for printing confirmation... # set reply = void echo " " while ($reply != 'y' && $reply != 'n') echo -n "Do you want a hardcopy of the logsheet? (y/n) " set reply = $< end # # Print catalog if it exists... # if ($reply == 'y') then # # Check that catalogue exists and is readable... # if !(-r $catalog) then echo $0": the file "$catalog" does not exist or is unreadable" exit(-1) else echo "Sending to "$printer a2ps -1 -r -s -F8 $catalog | lpr $printer #lp -olandscape -d$printer $catalog endif endif exit(0) error: echo "Usage: "$0 echo " " echo "[Further information --> "$0" -help]" echo "[See this script --> more `which "$0"`]" if($1 == "-help") then more `echo $0 | sed -e s/ObsLog.prt/ObsLog.man/` endif exit(-1)