1. You have 2 "#" signs in the shebang line.
2. If you want to print anything in a browser, you have to print a text/html
content type before printing anything, sso put the following line before:

print "Content-type: text/html\n\n";


Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

----- Original Message -----
From: "Mark-Nathaniel Weisman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, December 07, 2002 9:57 PM
Subject: A little help with uptime.


> Hey all,
>   I've got the script below that does not work, will anyone please tell me
what I've done wrong? I can't see where the script is failing and the logs
simply say that the script header is bad. I don't understand. Can someone
please help?
>
> ##!/usr/bin/perl
>
> >My (@machines,$host,$user,$pass)
>
> >Open(INFILE,"<machines.txt")
> > or die "Error opening machines.txt.$!,stopped"
> >@machines = <INFILE>;
> >Close(INFILE);
> >Foreach my $rec (@machines) {
> > chomp($rec);
> > ($host,$user,$pass) = split(/,/, $rec);
> > open (OUTFILE, ">records.txt")
> > or die "Error opening records.txt.$!,stopped";
> > close(OUTFILE);
> > open (OUTFILE, ">>records.txt")
> > or die "Error opening records.txt.$!,stopped";
> > print OUTFILE 'ssh -l $user $host "uptime"';
> > close(OUTFILE);
> >};
> Without the greater than marks of course. Where am I going wrong? Help
please?
> Sample of machines.txt
> >192.168.x.1,mary,password
> I'm trying to capture the data from the uptime command into a file that is
erased every time the script is run.
>
> His Faithful Servant,
> Rev. Mark-Nathaniel Weisman
>




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

Reply via email to