Skip to content

mrJeppard/jqtrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

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

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages