From ef0556b2123644377182a9f43a4b2a753cb571a6 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Thu, 5 Sep 2019 18:07:43 +0200 Subject: [PATCH] ignore SIGINT so partial input is shown Assume interrupt stops pipes and we can continue. Subsequent signals will then be reset so calculation can still be killed. --- graph | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/graph b/graph index 14b7173..d317df5 100755 --- a/graph +++ b/graph @@ -31,6 +31,8 @@ if (defined $opt{follow}) { alarm $opt{follow}; } +$SIG{INT} = 'IGNORE'; # continue after assumed eof + my (@lines, @values); while (readline) { chomp; @@ -48,6 +50,8 @@ while (readline) { } @lines or exit; +$SIG{INT} = 'DEFAULT'; + sub show_lines { my @order = sort { $b <=> $a } grep { length } @values; -- 2.30.0