cia-2010-covert-communication-websites/bigb-to-json-merge
#!/usr/bin/env bash
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
jq -s \
'add|unique_by(.host)|sort_by(if has("ip") then .ip|split(".")|map(tonumber) else null end, .host)' \
"$script_dir/../../media/cia-2010-covert-communication-websites/hits.json" \
<( "$script_dir/bigb-to-json" cia-2010-covert-communication-websites.bigb ) |
sed 's/^ //'