#!/bin/sh -- # A comment mentioning perl, to prevent perl from looping. Indented to work with bash. eval 'exec perl -S $0 ${1+"$@"}' if 0; #!/usr/bin/perl if ( $ARGV[0] eq '-s' ) { shift; $s = ' '; } else { $s = ''; } if ( $ARGV[0] eq '-b' ) { shift; $b1 = $ARGV[0]; shift; $b2 = $ARGV[0]; shift; # print STDERR "b1: $b1\n"; # print STDERR "b2: $b2\n"; } while (<>) { if ( $b1 ne '' ) { $_ =~ s,${b1}[^${b2}]*${b2},$s,g; } else { $_ =~ s,\<[^\>]*\>,$s,g; $_ =~ s,\([^\)]*\),$s,g; $_ =~ s,\{[^\}]*\},$s,g; $_ =~ s,\[[^\]]*\],$s,g; } print; }