Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

jqtrix

A reference for common tasks with jq.

Scripts

First arg for all scripts is 'key', 2nd is optional file path.

bin/del: delete all matching keys anywhere in the json

Snippets

# delete all keys matching 'leaf'
cat simple.json | jq 'del(.. | .leaf?)'
# function to add key value
add(){
    KEY=$1
    VALUE=$2
    jq --arg KEY $KEY --arg VALUE $VALUE 'map(.[$KEY] = $VALUE)'
}
cat simple.json | add new key

About

Reference for json parsing in bash with jq.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages