#! /usr/bin/perl
my $cmd ;
if ($#ARGV == 0) {
  $cmd = $ARGV[0] ;
  print "Executing ${cmd}\n" ;
}
foreach $mach (
    'alarka',
    'aquone',
    'burningtown',
    'cartoogechaye',
    'cataloochee',
    'cowee',
    'cullasaja',
    'cullowhee',
    'eastatoe',
    'ellijay',
    'etowah',
    'fairview',
    'fletcher',
    'iotla',
    'nantahala',
    'saunook',
    'stecoah',
    'swannanoa',
    'tellico',
    'tryon',
    'tuckasegee'
    ) {
    print "Connecting to ${mach}\n" ;
    if (defined($cmd)) {
	system '/usr/bin/ssh', '-Y', '-l', 'uncacsci', "${mach}.cs.unca.edu",
	$cmd ;
    } else {
	system '/usr/bin/ssh', '-Y', '-l', 'uncacsci', "${mach}.cs.unca.edu" ;
    }
}
