Array Union

Combine two arrays and remove duplicates to produce a union.

Code

General
echo "$arr1" | jq --argjson b "$arr2" '. + $b | unique'

Parameters

First JSON array

Second JSON array

Server

More Bash Snippets