#!/bin/sh
#
# something like 'LOAD"$",8:LIST', needs petcat (VICE)
#

PETCAT=petcat

dev=${1:-8}

echo "\`$0 deprecated, use \`cbmctrl dir $dev instead" >&2

if [ -z `type -p $PETCAT` ]; then
    echo $PETCAT 'not found, get VICE!'
	exit 1
fi

if ! cbmctrl status $dev > /dev/null; then
    echo device not present
	exit 1
fi

cbmctrl command $dev "I0:"
cbmctrl open    $dev 0 "\$"

cbmctrl talk	$dev 0
cat /dev/cbm | $PETCAT | tail +4
cbmctrl untalk

cbmctrl close   $dev 0
cbmctrl status  $dev
