mirror of
https://github.com/Fechin/reference.git
synced 2026-11-22 05:51:48 +03:00
Updated awk :target
This commit is contained in:
1 parent
ddc963bad7
commit
1864f3377a
1 file changed
+11
-11
@@ -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)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user