From 1046af946ab5cf28b1c0edc2db5f56bed5659995 Mon Sep 17 00:00:00 2001 From: Bob McWhirter Date: Tue, 4 May 2021 15:25:35 -0400 Subject: [PATCH] Quick scripts to plunge through the JSONs. --- files_for.sh | 3 +++ rm_for.sh | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100755 files_for.sh create mode 100755 rm_for.sh diff --git a/files_for.sh b/files_for.sh new file mode 100755 index 0000000..ed12c4b --- /dev/null +++ b/files_for.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +jq -r ".MCUs[] | select(.RPN == \"$1\") | .files[].file_id" sources/mcufinder/mcus.json diff --git a/rm_for.sh b/rm_for.sh new file mode 100755 index 0000000..b202f08 --- /dev/null +++ b/rm_for.sh @@ -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