#! /bin/csh
# admap - create and spool a PostScript file formatted to be read by admap.ps
# The format of an input line is as follows:
# admap "COMMAND VALUE" ... [ "OFFSET x y" ] mapfile [ "OFFSET x y" ...]
#
# Example: admap "WIDTH 12" "HEIGHT 20" trinity.map "OFFSET 6 10"
# This will print two pages of the map, one with ll as (0,0) and one with ll
# as (6, 10). Both pages will have width 12 and height 20.
#
set slask=/tmp/admap.$$
cat admap.ps > $slask
foreach i ($*:q)
  set foo=$i
  if (-r $foo) then
    set file=$foo
    cat $file >> $slask
  else
    echo $i >> $slask
    if ($?file) then
      cat $file >> $slask
    endif
  endif
end
lpr -r -JADMAP $slask
