#!/usr/bin/perl -nw # Process duplicity structured records to display only messages of interest. # Record format: # CATEGORY LEVEL [INFO] # . FREEFORM TEXT (one or more lines, each prefixed with ". ") # use strict; BEGIN { $/ = ""; # records are separated by a blank line } # skip INFO 1 messages completely, except for uploading status next if(/^INFO 1/ && !/ Uploading /); s/^.+\n//; # remove "CATEGORY LEVEL" line s/^\. //mg; # remove ". " message prefix from each line chomp; # remove record separator newlines print "$_\n";