# Name: # xterm.pl. # # Purpose: # Start an XTerm on unixBox. # # Author: # Ron Savage # http://savage.net.au/index.html # # Licence: # Australian Copyright (c) 1999-2002 Ron Savage. # # All Programs of mine are 'OSI Certified Open Source Software'; # you can redistribute them and/or modify them under the terms of # The Artistic License, a copy of which is available at: # http://www.opensource.org/licenses/index.html use strict; use Net::Telnet; #------------------------------------------------------------------------------ my($host, $username, $password, $prompt, $logFileName) = ( 'unix-box', 'user-name', 'pass-word', '/\$/', 'xterm.log', ); my($session); $session = new Net::Telnet ( Timeout => 10, Prompt => $prompt ); $session -> input_log($logFileName); $session -> open($host); $session -> login($username, $password); # Warning: Use spaces and not tabs to separated fields within these strings. # Net::Telnet strips the tabs and does not replace them with a space. # Does not work. Why? $session -> cmd('./bin/xts 192.168.1.2'); $session -> cmd('./bin/xt cornsilk firebrick4 192.168.1.2'); $session -> cmd('./bin/xt lavenderblush indianred4 192.168.1.2'); $session -> cmd('./bin/xt palegoldenrod darkgreen 192.168.1.2'); $session -> cmd('./bin/xt palegoldenrod navyblue 192.168.1.2'); $session -> cmd('./bin/xt whitesmoke dimgray 192.168.1.2'); $session -> close();