aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/awk.md
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/awk.md')
-rw-r--r--src/tools/awk.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tools/awk.md b/src/tools/awk.md
index a0c2470..d6f6c9c 100644
--- a/src/tools/awk.md
+++ b/src/tools/awk.md
@@ -144,6 +144,12 @@ echo 'a b c d e f' | awk '{ print $NF $(NF-1) }'
```
Access last fields with arithmetic on the `NF` number of fields variable.
+### Split on multiple tokens
+```bash
+echo 'a,b;c:d' | awk -F'[,;:]' '{ printf "1=%s | 4=%s\n", $1, $4 }'
+```
+Use regex as field separator.
+
### Capture in variables
```bash
# /proc/<pid>/status