Quick scripts to plunge through the JSONs.

This commit is contained in:
Bob McWhirter 2021-05-04 15:25:35 -04:00
parent ea80d8434b
commit 1046af946a
2 changed files with 14 additions and 0 deletions

3
files_for.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
jq -r ".MCUs[] | select(.RPN == \"$1\") | .files[].file_id" sources/mcufinder/mcus.json

11
rm_for.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
#jq ".MCUs[] | select(.RPN == \"$1\") | .files[].file_id" sources/mcufinder/mcus.json
files=$(./files_for.sh $1)
#echo $files
for candidate in $files
do
jq -e ".Files[] | select(.id_file == \"$candidate\") | select(.type == \"Reference manual\")" ./sources/mcufinder/files.json
done