Updated awk :target

This commit is contained in:
Randy8080 committed 2021-01-04 15:13:23 +08:00
1 parent ddc963bad7
commit 1864f3377a
1 file changed
+11 -11
+11 -11
View File
@@ -49,16 +49,16 @@ awk '
### Variables {.row-span-2}
```
$1 $2/$(NF-1) $3/$NF
▼ ▼ ▼
┌──────┬───────────┬───────┐
$0/NR ▶ | id | name | age |
├──────┼───────────┼───────┤
$0/NR ▶ | 1 | Roberta | 39 |
├──────┼───────────┼───────┤
$0/NR ▶ | 2 | Oliver | 25 |
└──────┴───────────┴───────┘
```bash
$1 $2/$(NF-1) $3/$NF
▼ ▼ ▼
┌──────┬──────────────┬───────┐
$0/NR ▶ │ ID │ WEBSITE │ URI │
├──────┼──────────────┼───────┤
$0/NR ▶ │ 1 │ quickref.me │ awk │
├──────┼──────────────┼───────┤
$0/NR ▶ │ 2 │ google.com │ 25 │
└──────┴──────────────┴───────┘
```
---
@@ -75,7 +75,7 @@ awk -F: '{print $(NF-1)}' /etc/passwd
# Custom string
awk -F: '{print $1 "=" $6}' /etc/passwd
```
See: [Variables](#variables)
See: [Variables](#variables-2)