#!/usr/bin/perl -wi.bak use strict; my $snip_flag; my $root_col="#5477A0"; while (<>) { /xsri/ and $snip_flag=1; m/xsetroot.*\"([^\"]+)\"/ and $root_col=$1; if ($snip_flag) { next unless /^\s*fi\s*$/; print <