#!/bin/ksh if [ ! $1 ]; then echo "usage: $0 DOMAIN" 1>&2 exit fi term=`xenstore-ls| grep -B1 " name = \"$1\"" | grep tty|cut -d \" -f 2` if [ $term ]; then cu -l $term else echo "$0: domain \"$1\" not found" 1>&2 fi