qsl has asked for the wisdom of the Perl Monks concerning the following question:
For the above code,if back-20.bak file is availabe in the remote machine in the location /sapp/backup and if the content of the file is having data like "Backup taken for this file" I have to assign status as pass or if the content is not available in that file status is assigned to fail.$checkfile = "back-20.bak"; $direcory ="/sapp/backup"; $contcheck = "Backup taken for this file"; $telnet->cmd("opendir dhandle,$directory"); @dots = $telnet->cmd("grep { /^$checkfile/ } readdir(dhandle)"); print"Files=> @dots\n"; foreach $filename (@dots) { chomp($filename); @filecont = $telnet->cmd("grep -i $contcheck"); foreach $line (@filecont) { if($line =~ /$contcheck/){ $status = 'FAIL'; }else{ $status ='PASS'; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Remote server file access issue
by Sidhekin (Priest) on Jun 29, 2006 at 12:34 UTC | |
| |
|
Re: Remote server file access issue
by shmem (Chancellor) on Jun 29, 2006 at 14:07 UTC | |
|
Re: Remote server file access issue
by dsheroh (Monsignor) on Jun 29, 2006 at 15:53 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |