summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-06-02 19:25:29 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-06-02 19:25:29 +0200
commit3aa0fcc86f0d7ff6224887522ec61bcdfc806ebf (patch)
treef7a89f038d37ed73559ed0004cfd1147536e5b7c
parent909ee3f62040b55306e19d20cd3438aefbca1c29 (diff)
Erase next column
-rwxr-xr-xbin/ekgping7
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{^};