<?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>command</anon>
    <anon>jq</anon>
  </categories>
  <description>簡単にできるやろと思ったらそんなことなかったのでメモしておく 件数指定する 単純に件数を指定するだけであればlimitでOK $ echo '[1,2,3,4,5,6,7,8,9,10]' | jq 'limit(3; .[])' 1 2 3 これは簡単 絞り込みや並び替え後に件数指定する 上記のような単純な処理のみであれば問題ないのだが、selectを使いだすと何か処理させた後にパイプで渡ってくる値がどのような状態か意識しないとうまくいかなくなる リストから偶数を3件出力する $ echo '[1,2,3,4,5,6,7,8,9,10]' | jq 'limit(3; .[]|select(…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fswfz.hatenablog.com%2Fentry%2F2020%2F05%2F21%2F043156&quot; title=&quot;jqで任意の件数だけ出力する - 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></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-05-21 04:31:56</published>
  <title>jqで任意の件数だけ出力する</title>
  <type>rich</type>
  <url>https://swfz.hatenablog.com/entry/2020/05/21/043156</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
