<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>swfz</author_name>
  <author_url>https://blog.hatena.ne.jp/swfz/</author_url>
  <blog_title>notebook</blog_title>
  <blog_url>https://swfz.hatenablog.com/</blog_url>
  <categories>
    <anon>jq</anon>
    <anon>command</anon>
  </categories>
  <description>RubyでいうHash.merge的な処理をjqでもやりたいとき 集計結果をいくつかのファイルに出力しておき最後にサマリーとしてJSONにまとめたいときなどに使う 書いていて感じたけどあまりこういう機会はないかもしれない… 01.json { &quot;hoge&quot;: 1, &quot;fuga&quot;: 2 } 02.json { &quot;fuga&quot;: 3, &quot;piyo&quot;: 4 } 結論 $ cat 01.json 02.json | jq -s 'reduce .[] as $n ({}; . * $n)' { &quot;hoge&quot;: 1, &quot;fuga&quot;: 3, &quot;piyo&quot;: 4 } キーの値は後に来たものが優先される $ c…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fswfz.hatenablog.com%2Fentry%2F2021%2F05%2F26%2F200441&quot; title=&quot;jqで複数ハッシュのmergeをする - notebook&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/s/swfz/20210526/20210526200408.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-05-26 20:04:41</published>
  <title>jqで複数ハッシュのmergeをする</title>
  <type>rich</type>
  <url>https://swfz.hatenablog.com/entry/2021/05/26/200441</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
