The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 08-29-2008
xist xist is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 7
in this redaction:

Code:
use strict;
use warnings;
open FILE, "/tmp/result_2";
my $regex="\\[INFO\\] Starting program ver. (.*)";
my $res='Program started, version <$1> - OK.\n';
while (<FILE>) {
if ($_ =~ /$regex/) {
   eval print $res;
    }
}
close FILE;

doesn't work as well