If you have a list of servers to look at (e.g. in a file called "server.list" on your mswin machine), and a list of files to look for on each server (e.g. in separate files called "{servername}.filelist", also on the mswin machine), an easy way get what you want via a perl script on the mswin machine might be something like:
You should be using a shell on the mswin machine that allows for redirection of stdout to a chosen file, or you can open an explicit output file in the perl script.#!/usr/bin/perl # (standard shebang line, in case you get to use this on unix/linux so +meday) use strict; use warnings; open( SLIST, '<', "server.list" ) or die "server.list: $!\n"; while ( my $server = <SLIST>) { chomp $server; open( FLIST, '<', $server.filelist ) or do { warn "$server.filelist: $!\n"; next; } my $srvr_cmd = "ls -l"; while ( <FLIST> ) { chomp; $srvr_cmd .= " $_"; } my $file_info = `ssh $server $srvr_cmd`; print "=== results from $server ===\n$file_info\n"; }
If you're trying to do something more complicated or subtle, and the above doesn't help with that, please be more explicit about what you're really trying to accomplish.
In reply to Re: run a perl script on a unix machine from a win machine
by graff
in thread run a perl script on a unix machine from a win machine
by akrrs7
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |