1#!/usr/bin/perl 2 3# Copyright (c) International Business Machines Corp., 2001 4# 5# This program is free software; you can redistribute it and/or modify 6# it under the terms of the GNU General Public License as published by 7# the Free Software Foundation; either version 2 of the License, or 8# (at your option) any later version. 9# 10# This program is distributed in the hope that it will be useful, 11# but WITHOUT ANY WARRANTY; without even the implied warranty of 12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 13# the GNU General Public License for more details. 14# 15# You should have received a copy of the GNU General Public License 16# along with this program; if not, write to the Free Software 17# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 19# FILE : ltpoutput2 20# DESCRIPTION : reads from STDIN and rips failures out of the output from PAN 21# HISTORY : 22# 12/12/2001 Robbie Williamson (robbiew@us.ibm.com) 23# adapted from `ltpoutput` 24 25 26$buf = <STDIN>; 27foreach $_ (<>) { 28 $line = $_; 29 $buf = $buf . $line; 30 if($line =~ '<<<test_end>>>') { 31 if($buf =~ "termination_id=[^0]") { 32 $buf =~ tr/<>/-/; 33 print $buf; 34 } 35 $buf = ""; 36 } 37 if($line =~ "^pan reported") { 38 print $line; 39 } 40} 41