diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-06-02 19:25:29 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-06-02 19:25:29 +0200 |
commit | 3aa0fcc86f0d7ff6224887522ec61bcdfc806ebf (patch) | |
tree | f7a89f038d37ed73559ed0004cfd1147536e5b7c /bin/ekgping | |
parent | 909ee3f62040b55306e19d20cd3438aefbca1c29 (diff) |
Erase next column
Diffstat (limited to 'bin/ekgping')
-rwxr-xr-x | bin/ekgping | 7 |
1 files changed, 6 insertions, 1 deletions
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{^}; |