Skip to content

Commit 055144f

Browse files
committed
Add README file
1 parent 3e1e332 commit 055144f

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

Bash/JSON_Parse_with_jq/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
### json parsing in bash
2+
3+
`find_flag.sh` sctipt will tell you how to use [jq](https://stedolan.github.io/jq/) command to parse JSON file in bash with an example (`sample.json`)
4+
5+
The script will run below 3 commands and find the flag from the `sample.json` file
6+
7+
```bash
8+
$ cat sample.json | jq "." | head -n 13
9+
```
10+
11+
```bash
12+
$ cat sample.json | jq ".data.allPosts.edges[0:3]"
13+
```
14+
15+
```bash
16+
$ cat sample.json | jq ".data.allPosts.edges" | grep -E -o 'RotteN{.*}' | grep -v 'harder'
17+
```

Bash/JSON_Parse_with_jq/find_flag.sh

100644100755
File mode changed.

0 commit comments

Comments
 (0)