Array Difference

Find elements in the first array that are not present in the second array.

Code

General
echo "$arr1" | jq --argjson b "$arr2" '[.[] | select(. as $x | $b | index($x) | not)]'

Parameters

First JSON array

Second JSON array

Server

More Bash Snippets