2022-08-05 20:47:29 +00:00
|
|
|
# execline-json
|
|
|
|
|
|
|
|
> why would you even do that
|
|
|
|
|
|
|
|
json parser written (mostly) in execline
|
|
|
|
|
2022-08-05 21:04:47 +00:00
|
|
|
**this is a joke, it's not a proper json parser and
|
|
|
|
probably even has some command injection vulnerability.
|
|
|
|
do NOT use this.**
|
|
|
|
|
2022-08-05 20:47:29 +00:00
|
|
|
requirements:
|
|
|
|
- execline
|
|
|
|
- [execline-state](https://git.ddd.rip/ptrcnull/execline-state)
|
|
|
|
- s6-portable-utils
|
|
|
|
- sed
|
|
|
|
- tr
|
|
|
|
- cut (with delimiter/fields support)
|
|
|
|
|
|
|
|
### usage
|
|
|
|
|
|
|
|
```sh
|
|
|
|
#!/bin/execlineb
|
|
|
|
|
|
|
|
backtick -E users_json { curl https://gitlab.com/api/v4/users?username=ptrcnull }
|
|
|
|
json users "$users_json"
|
|
|
|
foreground { s6-echo "${users[0]}" }
|
|
|
|
s6-echo "${users[0][id]}"
|
|
|
|
```
|