#!/bin/csh

######################################################
# Shell script to submit call report
# Adds 9 spaces to the beginning of every line 
# Lee Chia Ling
# Created 15 June 1993
# Changed 28 July 1993
# --- check for 2nd argument, 
#       if present, take it as report recipients
#       else send report to imd 
# Changed 9 Oct 1993
# --- Adapt to NSRC need
# --- only print it out
# Changed 11 Dec 1993
# --- renamed cr2
# --- printing duplex
######################################################

######################################################
# Test number of Arguments. 
######################################################
set R = "tzefoon%a1@ivx001 boonsan%a1@ivx001 \
        danielcheong%a1@ivx001 sugu%a1@ivx001 \
        yumin%a1@ivx001 sooklih%a1@ivx001 \
        craiglim%a1@ivx001 amyneo%a1@ivx001 \
        kaymok%a1@ivx001 chialing%a1@ivx001"

if ("$1" == "") then
        echo "Usage: cr call_report"
#       echo "Usage: cr call_report [recipient(s)]"
        echo "(automatcially format and send cr)"
        exit
endif
if ("$2" != "") then 
        echo "2nd argument onwards are ignored"
endif
##################################################
# 9 OCt 1993
# --- the following is not needed anymore
##################################################
# if ("$2" != "") then 
#       set R = $2
# endif
# if ("$3" != "") then 
#       echo "3rd argument onwards are ignored"
# endif

#####################################################
# Done checking. 
# (No error checking on file presence)
#####################################################
# echo "call report " $1 " is being sent to " $R
# expand $1 | sed '1,$s/^/         /' | \
# mail -s "Call Report" $R
expand $1 | sed '1,$s/^/         /' | lp -onb -oduplex
#####################################################
#                       check number of spaces
#                       123456789
#####################################################
echo done

1