diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-06-02 13:42:54 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-06-02 13:42:54 +0200 |
commit | 608a930b5751b79cc86d4318f67ebfaacb5f3ce7 (patch) | |
tree | d53fbf6594bd74a54defe9f868a716909cc6f5d0 | |
parent | 18e96317f24f8240857101999e2c3a4f8c5a9c37 (diff) |
Rewrite line every 80 chars
-rwxr-xr-x | bin/ekgping | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/ekgping b/bin/ekgping index 65b066f..f8d13da 100755 --- a/bin/ekgping +++ b/bin/ekgping @@ -16,6 +16,7 @@ my $last_id = 0; my $beep; my $was_beep = 1; my $dead_count = 0; +my $column = 0; my $ping = harness( [ 'ping', '-n', $host ], @@ -46,6 +47,11 @@ while ( usleep(100_000) ) { $ping->pump_nb(); + if ($column++ == 80) { + print "\r"; + $column = 0; + } + if ( $id != $last_id ) { $beep = 1; print q{^}; |