From 60ee870ae54aca5f8a247e45fcc71a6b24d64ac5 Mon Sep 17 00:00:00 2001 From: Nikita Zlobin Date: Thu, 24 Dec 2020 00:14:32 +0500 Subject: [PATCH] Oops, avoid gawk coprocess extension --- doc/tint2.1 | 2 +- doc/tint2.html | 2 +- doc/tint2.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/tint2.1 b/doc/tint2.1 index 3d62190..a0fadc1 100644 --- a/doc/tint2.1 +++ b/doc/tint2.1 @@ -833,7 +833,7 @@ execp_markup = 1 .nf # Though unnecessary here, "stdbuf -oL" performs better than fflush() in awk code execp = new -execp_command = free -b -s1 | stdbuf -oL awk '/^Mem:/ { c="numfmt --to=si"; print $2 |& c; c |& getline a; printf "Mem: %s %.0f%%\n", a, 100 * ($2 - $7) / $2 }' +execp_command = free -b -s1 | stdbuf -oL awk '/^Mem:/ { printf "Mem: %s %.0f%%\n", $2, 100 * ($2 - $7) / $2 }' | stdbuf -oL numfmt --to=iec-i --field=2 -d' ' execp_interval = 1 execp_continuous = 1 .fi diff --git a/doc/tint2.html b/doc/tint2.html index 44cd3da..97bdd77 100644 --- a/doc/tint2.html +++ b/doc/tint2.html @@ -374,7 +374,7 @@ execp_markup = 1
Memory usage
# Though unnecessary here, "stdbuf -oL" performs better than fflush() in awk code
 execp = new
-execp_command = free -b -s1 | stdbuf -oL awk ‘/^Mem:/ { c=“numfmt –to=si”; print $2 |& c; c |& getline a; printf “Mem: %s %.0f%%\n”, a, 100 * ($2 - $7) / $2 }’
+execp_command = free -b -s1 | stdbuf -oL awk '/^Mem:/ { printf "Mem: %s %.0f%%\n", $2, 100 * ($2 - $7) / $2 }' | stdbuf -oL numfmt --to=iec-i --field=2 -d' '
 execp_interval = 1
 execp_continuous = 1
 
diff --git a/doc/tint2.md b/doc/tint2.md index d1a27b1..6d6ecaf 100644 --- a/doc/tint2.md +++ b/doc/tint2.md @@ -696,7 +696,7 @@ execp_markup = 1 ``` # Though unnecessary here, "stdbuf -oL" performs better than fflush() in awk code execp = new -execp_command = free -b -s1 | stdbuf -oL awk '/^Mem:/ { c="numfmt --to=si"; print $2 |& c; c |& getline a; printf "Mem: %s %.0f%%\n", a, 100 * ($2 - $7) / $2 }' +execp_command = free -b -s1 | stdbuf -oL awk '/^Mem:/ { printf "Mem: %s %.0f%%\n", $2, 100 * ($2 - $7) / $2 }' | stdbuf -oL numfmt --to=iec-i --field=2 -d' ' execp_interval = 1 execp_continuous = 1 ```