From 3aa0fcc86f0d7ff6224887522ec61bcdfc806ebf Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 2 Jun 2011 19:25:29 +0200 Subject: Erase next column --- bin/ekgping | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/ekgping b/bin/ekgping index aca2c3f..8786682 100755 --- a/bin/ekgping +++ b/bin/ekgping @@ -17,6 +17,7 @@ my $beep; my $was_beep = 1; my $dead_count = 0; my $column = 0; +my $column_max = 80; my $ping = harness( [ 'ping', '-n', $host ], @@ -58,11 +59,15 @@ while ( usleep(100_000) ) { $ping->pump_nb(); - if ( $column++ == 80 ) { + if ( $column++ == $column_max ) { print "\r"; $column = 0; } + if ( $column != $column_max) { + print "\e[1C \e[1D\e[1D"; + } + if ( $id != $last_id ) { $beep = 1; print q{^}; -- cgit v1.2.3