NET::TELNET

2001-11-21 Thread Daryl Hoyt

Hi,
I have used this example program to telnet to a
different box (from a RH Linux 6.2 box to a FreeBSD
box), but I cannot get the right output.  It appears
to just echo the command and the path.  Any ideas what
I am doing wrong.  I thought it was supposed to print
out the list of who is on the machine.  I know there
are at least 10 people on this machine.  Any help
would be appreciated.

###
Screen output:
###
[djh@duke:~/telnet]$ ./run.pl 
/usr/bin/who

/chicago/sqa/sqa
sqa@sparky[djh@duke:~/telnet]$
###

###
Code
###
#!/usr/local/bin/perl -w

use Net::Telnet ();

$username = sqa;
$passwd = sqa;
$machine = sparky;
my $command = /usr/bin/who;

$t = new Net::Telnet (Timeout = 15, Prompt =
'/\#/');
$t-open($machine);
$t-login($username, $passwd);
my @array = $t-cmd($command);
print @array;
$t-close;
###


__
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Help with net::telnet

2001-11-08 Thread Daryl Hoyt

Hi,
I am trying to get Perl telnet to work on our *nix
boxes, and I am missing something.  I'm sure it is
obvious.  If anyone can help.  I would appreciate it. 
Listed below is the code I use and the login screen
from one of our FreeBSD boxes (sparky).
 
+
#!/usr/local/bin/perl -w
 
use Net::Telnet ();
 
$username = sqa;
$passwd = sqa;
$machine = sparky;

print $t = new Net::Telnet (Timeout = 10, Prompt =
'/$username\@$machine\#/');
print $t-open($machine);
print $t-login($username, $passwd);
$t-cmd(p4 sync -f
//info.geodesic.com/eng/pe/tools/bin/...);
+
 
Trying XXX.XXX.XXX.XXX...
Connected to sparky.geodesic.com.
Escape character is '^]'.
 
FreeBSD/i386 (sparky.geodesic.com) (ttyp1)
 
login: sqa
Password:
Last login: Thu Nov  8 10:41:46 from duke
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991,
1993, 1994
The Regents of the University of California. 
All rights reserved.
 
FreeBSD 3.5-STABLE (sparky) #6: Sat Nov  4 12:00:07
CST 2000
 
/chicago/sqa/sqa
sqa@sparky# 
+
 
Thanks,

Daryl Hoyt

__
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Converting Unix paths to windows

2001-06-27 Thread Daryl Hoyt

Hi,
I am writing a script to be used on Windows and many different flavors
of Unix.  I am looking for a good way to convert Unix paths to Windows.  Any
Ideas?

Thanks,

Daryl J. Hoyt
Performance Engineer
Geodesic Systems
http://www.geodesic.com
[EMAIL PROTECTED]




RE: system

2001-06-07 Thread Daryl Hoyt

Hi,
Make sure the path to your exe is correct.  I had that problem before.

 -Original Message-
 From: prachi shroff [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, June 07, 2001 8:01 AM
 To: [EMAIL PROTECTED]
 Subject: system
 
 
 Hi,
 
 I am trying to run an executable file from within my perl script 
 using the 
 SYSTEM command. If I run the exe from either the command line or 
 by double 
 clicking, it works fine, but when I embed it into the perl script 
 it gives 
 errors compiling. It is an exe of a C code and shows errors 
 specific to the 
 code like error opening a file that it needs to read.
 
 Could anyone please give in any suggestions.
 
 Thanks,
 Prachi
 _
 Get your FREE download of MSN Explorer at http://explorer.msn.com