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

  Write catalogs to an 80 character per card ascii card image tape
    usage: tapecat device blocking catalog [catalog ...]
    Arguments: device - /dev/rmt12 for ts11, /dev/rmt5 for kennedy
			at 800 bpi and /dev/rmt13 for kennedy at 1600 bpi
	       blocking - the number of characters per record
	       catalog - 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 ($*)
info $i|pad -n -80|dd obs=$bs|dd bs=$bs of=$dev conv=sync >&/dev/null
<$i catdump|dd obs=$bs|dd bs=$bs of=$dev conv=sync >&/dev/null
end
