Skip to content

Instantly share code, notes, and snippets.



Created Jan 23, 2016
What would you like to do?
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
my $line = $ARGV[0];
my $margin = $ARGV[1] // 0;
open my $dst, '|-', "head -n @{[$line + $margin]} | tail -n @{[$margin * 2 + 1]}";
while (<STDIN>){
print $dst $_;
close $dst;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.