> 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 
> 


Reply via email to