From 4e80ad2d34f307991562c364b157d1c7a502cd96 Mon Sep 17 00:00:00 2001 From: johannst Date: Fri, 23 Sep 2022 18:29:01 +0000 Subject: deploy: 29c1b6a06f8d5c546fbd5514731c4ac4c504f6c3 --- tools/awk.html | 17 ++++++++++++++++- tools/bash.html | 2 +- tools/dot.html | 2 +- tools/emacs.html | 2 +- tools/fish.html | 2 +- tools/gdb.html | 2 +- tools/gdbserver.html | 2 +- tools/git.html | 2 +- tools/gpg.html | 2 +- tools/index.html | 2 +- tools/pacman.html | 2 +- tools/qemu.html | 2 +- tools/radare2.html | 2 +- tools/tmux.html | 2 +- tools/zsh.html | 2 +- 15 files changed, 30 insertions(+), 15 deletions(-) (limited to 'tools') diff --git a/tools/awk.html b/tools/awk.html index 2b7b348..abcd01b 100644 --- a/tools/awk.html +++ b/tools/awk.html @@ -75,7 +75,7 @@ @@ -253,6 +253,21 @@ done | sort -k2 -n

We capture values from VmRSS and Name into variables and print them at the END once processing all records is done.

+

Capture in array

+
echo 'a 10
+b 2
+b 4
+a 1' | awk '{
+    vals[$1] += $2
+    cnts[$1] += 1
+}
+END {
+    for (v in vals)
+        printf "%s %d\n", v, vals[v] / cnts [v]
+}'
+
+

Capture keys and values from different columns and some up the values. +At the END we compute the average of each key.

Run shell command and capture output

cat /proc/1/status | awk '
                      /^Pid/ {
diff --git a/tools/bash.html b/tools/bash.html
index 1b0898a..84ae3ad 100644
--- a/tools/bash.html
+++ b/tools/bash.html
@@ -75,7 +75,7 @@
 
         
diff --git a/tools/dot.html b/tools/dot.html
index 99aabce..a8cb545 100644
--- a/tools/dot.html
+++ b/tools/dot.html
@@ -75,7 +75,7 @@
 
         
diff --git a/tools/emacs.html b/tools/emacs.html
index 3e9890d..b3b556e 100644
--- a/tools/emacs.html
+++ b/tools/emacs.html
@@ -75,7 +75,7 @@
 
         
diff --git a/tools/fish.html b/tools/fish.html
index 240c745..ebf52aa 100644
--- a/tools/fish.html
+++ b/tools/fish.html
@@ -75,7 +75,7 @@
 
         
diff --git a/tools/gdb.html b/tools/gdb.html
index e0892e0..7236619 100644
--- a/tools/gdb.html
+++ b/tools/gdb.html
@@ -75,7 +75,7 @@
 
         
diff --git a/tools/gdbserver.html b/tools/gdbserver.html
index f52f73c..6cbb806 100644
--- a/tools/gdbserver.html
+++ b/tools/gdbserver.html
@@ -75,7 +75,7 @@
 
         
diff --git a/tools/git.html b/tools/git.html
index ec5de97..c029cce 100644
--- a/tools/git.html
+++ b/tools/git.html
@@ -75,7 +75,7 @@
 
         
diff --git a/tools/gpg.html b/tools/gpg.html
index 5a6e1ca..bb4d2fc 100644
--- a/tools/gpg.html
+++ b/tools/gpg.html
@@ -75,7 +75,7 @@
 
         
diff --git a/tools/index.html b/tools/index.html
index de9d81d..bb47b18 100644
--- a/tools/index.html
+++ b/tools/index.html
@@ -75,7 +75,7 @@
 
         
diff --git a/tools/pacman.html b/tools/pacman.html
index f4d4c91..92037fc 100644
--- a/tools/pacman.html
+++ b/tools/pacman.html
@@ -75,7 +75,7 @@
 
         
diff --git a/tools/qemu.html b/tools/qemu.html
index 4f54630..a7fbf03 100644
--- a/tools/qemu.html
+++ b/tools/qemu.html
@@ -75,7 +75,7 @@
 
         
diff --git a/tools/radare2.html b/tools/radare2.html
index 9170b76..0c88832 100644
--- a/tools/radare2.html
+++ b/tools/radare2.html
@@ -75,7 +75,7 @@
 
         
diff --git a/tools/tmux.html b/tools/tmux.html
index 79cdc50..7dce9f0 100644
--- a/tools/tmux.html
+++ b/tools/tmux.html
@@ -75,7 +75,7 @@
 
         
diff --git a/tools/zsh.html b/tools/zsh.html
index 7a97b30..db27105 100644
--- a/tools/zsh.html
+++ b/tools/zsh.html
@@ -75,7 +75,7 @@
 
         
-- 
cgit v1.2.3