Sorry, I know this is OT in a java section, but it's easy to do this in perl
#/usr/bin/perl
use Net::Telnet; # you will need this installed, available from cpan.org, or your distro
$telnet = new Net::Telnet ( Timeout=>10,
Errmode=>'die'
Prompt => '/\$ $/i');
$telnet->open('remote.site.com');
$telnet->login('user', 'passwd');
print $telnet->cmd('something_or_other');
HTH,
Charlie
--
Don't Stand on your head - you'll get footprints in your hair.
http://www.charlieharvey.org.uk