in reply to Re: qx + sed not working
in thread qx + sed not working
Oh my, you're right. It is the blank lines that is causing the loop to stuck up.
Files.txt contains the ff. lines: C:/ProcessFiles/File1.txt C:/ProcessFiles/File2.txt C:/ProcessFiles/File3.txt C:/ProcessFiles/File4.txt C:/ProcessFiles/File5.txt
#!/usr/bin/perl use strict; use warnings; use File::Find; use Cwd; my @SetBCs; open(my $file, "<", "Files.txt") or die "Failed to open file: $!\n"; while(<$file>) { chomp; push @SetBCs, $_; } close $file; foreach (@SetBCs) { my $command = qx(sed -n "/Sets/,/Rules/p" $_); print $command; }
Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: qx + sed not working
by hippo (Archbishop) on Apr 20, 2018 at 13:58 UTC |