#!/bin/csh -f
# Write an ascii card image tape of a catalog
if ($1 == ^) then
  caterr <<'EOF'

  Write matched catalogs to an 80 character per card ascii card image tape
    usage: mtapecat device blocking mcatalog [mcatalog ...]
    Arguments: device - /dev/rmt12 for kennedy0, /dev/rmt5 for kennedy1
			at 800 bpi and /dev/rmt13 for kennedy at 1600 bpi
	       blocking - the number of characters per record
	       mcatalog - matched catalogs to be taped
    The entries and format of the tape is described in the FOCAS
    User's Manual.  The tape begins writing at its current position.
    Tape can be positioned with mt(UNIX).

'EOF'
  exit
endif

set dev=$1
set bs=$2
shift
shift
foreach i ($*)
minfo $i|pad -n -80|dd obs=$bs|dd bs=$bs of=$dev conv=sync
<$i mcatdump|dd obs=$bs|dd bs=$bs of=$dev conv=sync
end
