wcj75019 has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; my $agent = "best1agent_start"; my $collect = '/usr/bin/su - patrol /usr/adm/best1_default/bgs/scripts +/best1collect -q>>$LOG 2>>$LOG'; my $cf_dir = "/root/sysedge/cf_files"; open SH_FILES, "sh.file" or die "Error: $!"; my @sh_f=<SH_FILES>; close SH_FILES; foreach my $sh(@sh_f){ chomp $sh; open(OUT, "/tmp/$sh".".sysedge.sh"); my $line; open (SH, "$cf_dir/$sh") or die "ERROR $!"; while ($line = <SH>){ if($line =~ /$agent/){ $line = $collect; print OUT $line; } print OUT $line; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: print() on closed filehandle OUT at B.p line 19, <SH> line 1732.
by hipowls (Curate) on Feb 24, 2008 at 03:31 UTC | |
by wcj75019 (Acolyte) on Feb 24, 2008 at 03:53 UTC | |
by lidden (Curate) on Feb 24, 2008 at 17:03 UTC | |
by ikegami (Patriarch) on Feb 24, 2008 at 17:17 UTC | |
by lidden (Curate) on Feb 24, 2008 at 17:46 UTC | |
|
Re: print() on closed filehandle OUT at B.p line 19, <SH> line 1732.
by jwkrahn (Abbot) on Feb 24, 2008 at 03:46 UTC | |
|
Re: print() on closed filehandle OUT at B.p line 19, <SH> line 1732.
by olus (Curate) on Feb 24, 2008 at 20:41 UTC |