1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-13 01:20:24 +02:00

add key/value info to ini example

This commit is contained in:
Kelly Brazil
2020-07-27 10:28:15 -07:00
parent 38d10c9781
commit ebd8ee49a9

View File

@ -1242,7 +1242,7 @@ ifconfig | jc --ifconfig -p # or: jc -p ifconfig
}
]
```
### INI files
### INI and plain key/value pair files
```bash
cat example.ini
```
@ -1281,6 +1281,31 @@ cat example.ini | jc --ini -p
}
}
```
```bash
cat keyvalue.txt
```
```
# this file contains key/value pairs
name = John Doe
address=555 California Drive
age: 34
; comments can include # or ;
# delimiter can be = or :
# quoted values have quotation marks stripped by default
# but can be preserved with the -r argument
occupation:"Engineer"
```
```bash
cat keyvalue.txt | jc --ini -p
```
```json
{
"name": "John Doe",
"address": "555 California Drive",
"age": "34",
"occupation": "Engineer"
}
```
### iptables
```bash
iptables --line-numbers -v -L -t nat | jc --iptables -p # or: jc -p iptables --line-numbers -v -L -t nat