#! /bin/sh

file=0
case x"$1" in
	x-g)
		dd if=/dev/zero bs=1024 count=1
		exit 0
		;;
	x-[0z])
		file=0
		;;
	x-[1f])
		file=1
		;;
	x-[rR])
		file=R
		;;
	x-[pP])
		file=P
		;;
	x-[qQ])
		file=Q
		;;
esac

case "x$file" in
	x0)
		dd if=/dev/zero bs=1k count=32768 2>/dev/null
		exit 0
		;;
esac

zcat $file.dat.Z > /tmp/$file.dat

if [ ! -r /tmp/$file-1M.dat ]; then
	n=1024
	while [ $n -gt 0 ]; do
		cat /tmp/$file.dat >> /tmp/$file-1M.dat
		n=$(( $n - 1 ))
	done
fi

n=32
while [ $n -gt 0 ]; do
	dd if=/tmp/$file-1M.dat bs=1k 2>/dev/null
	n=$(( $n - 1 ))
done

# EOF
