]> git.sesse.net Git - bursty/commitdiff
Add a small script to deal with the fact that we might not have the entire receiver...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 28 May 2012 13:15:12 +0000 (15:15 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 28 May 2012 13:15:12 +0000 (15:15 +0200)
truncate-end.pl [new file with mode: 0755]

diff --git a/truncate-end.pl b/truncate-end.pl
new file mode 100755 (executable)
index 0000000..4975426
--- /dev/null
@@ -0,0 +1,17 @@
+#! /usr/bin/perl
+
+use strict;
+use warnings;
+
+my @buffer = ();
+
+while (<>) {
+       chomp;
+       if (/\d /) {
+               print join("\n", @buffer);
+               @buffer = ();
+               print "$_\n";
+       } else {
+               push @buffer, $_;
+       }
+}