{"id":321417,"date":"2021-04-14T09:00:39","date_gmt":"2021-04-14T09:00:39","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=321417"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=321417","title":{"rendered":"\u0421\u0431\u043e\u0440\u043d\u0438\u043a\u0438 \u0440\u0435\u0446\u0435\u043f\u0442\u043e\u0432 jq"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/27d\/961\/621\/27d9616217927e85ae25c65c96f6cc4a.png\" alt=\"jq intro\" title=\"jq intro\" width=\"1280\" height=\"760\"><figcaption>jq intro<\/figcaption><\/figure>\n<p>\u041c\u044b \u0432\u0441\u0435 \u0438\u043d\u043e\u0433\u0434\u0430 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 JSON \u0438\u043b\u0438 YAML \u0444\u0430\u0439\u043b\u043e\u0432. \u041c\u043d\u043e\u0433\u0438\u0435 \u0443\u0436\u0435 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 \u043c\u043e\u0449\u044c\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u044b jq. \u0421\u0443\u0434\u044f \u043f\u043e \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f\u043c \u043d\u0430 \u0425\u0430\u0431\u0440\u0435, \u043d\u0430\u043f\u0440. <a href=\"https:\/\/habr.com\/ru\/post\/525808\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/post\/525808\/<\/a>, \u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c \u0432 qna, \u0442\u0435\u043c\u0430 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430.<\/p>\n<p>\u041c\u043d\u0435 \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0440\u0430\u0437 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 DSL jq \u0447\u0442\u043e\u0431\u044b \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u043d\u044b\u0435 \u0437\u0430 \u0434\u043e\u043b\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0438 \u0432 \u0425\u0440\u043e\u043c\u0435, \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0435 \u043f\u0440\u0438 \u0430\u043f\u0433\u0440\u0435\u0439\u0434\u0435. \u0422\u043e\u0447\u043d\u0435\u0435, \u0444\u0430\u0439\u043b Bookmarks \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 .json \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b\u0441\u044f, \u043d\u043e \u043d\u0438 \u0432 \u043a\u0430\u043a\u0443\u044e \u043d\u0435 \u0445\u043e\u0442\u0435\u043b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043d\u043e\u0432\u044b\u0439 \u0425\u0440\u043e\u043c. \u0425\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0440\u0435\u0446\u0435\u043f\u0442\u043e\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0437\u0430\u043e\u0434\u043d\u043e \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0442\u044c \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u043c\u0438\u043d\u0438\u0430\u0442\u044e\u0440\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u0445\u043e\u0436\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c.<\/p>\n<p>JQ \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438 &#8212; \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438, \u0442\u0438\u043f\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u043e\u0439, \u0446\u0438\u043a\u043b\u0430\u043c\u0438 \u0438 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430\u043c\u0438, \u043c\u0430\u0441\u0441\u043e\u0439 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445. \u0423\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u0441\u0451 \u044d\u0442\u043e \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043a\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 30KB, \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435\u0439 &#171;man jq&#187; \u0442\u0430\u043a\u043e\u0433\u043e \u0436\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 libjq \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 300KB.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0432 \u0432 \u0441\u0432\u043e\u0439 Bookmarks \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u043e\u0442\u043d\u044f\u043c\u0438 \u0441\u0441\u044b\u043b\u043e\u043a, \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 &#8212; \u043a\u0430\u043a\u043e\u0432\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u044d\u0442\u043e\u0433\u043e .json \u0444\u0430\u0439\u043b\u0430? \u041f\u043e \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u044f \u0443\u0436\u0435 \u0437\u043d\u0430\u043b \u043a\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e \u0435\u0451 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445. \u0412\u043e\u0442 \u044d\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430:<\/p>\n<p><code> ... $ jq '[paths|join(\".\")]' Bookmarks|head -n 16<br \/>[<br \/>       \"checksum\",<br \/>       \"roots\",<br \/>       \"roots.bookmark_bar\",<br \/>       \"roots.bookmark_bar.children\",<br \/>       \"roots.bookmark_bar.children.0\",<br \/>       \"roots.bookmark_bar.children.0.children\",<br \/>       \"roots.bookmark_bar.children.0.children.0\",<br \/>       \"roots.bookmark_bar.children.0.children.0.children\",<br \/>       \"roots.bookmark_bar.children.0.children.0.children.0\",<br \/>       \"roots.bookmark_bar.children.0.children.0.children.0.date_added\",<br \/>       \"roots.bookmark_bar.children.0.children.0.children.0.guid\",<br \/>       \"roots.bookmark_bar.children.0.children.0.children.0.id\",<br \/>       \"roots.bookmark_bar.children.0.children.0.children.0.name\",<br \/>       \"roots.bookmark_bar.children.0.children.0.children.0.type\",<br \/>       \"roots.bookmark_bar.children.0.children.0.children.0.url\",<\/code><\/p>\n<p>\u0412\u0441\u0435\u0433\u043e \u0441\u0442\u0440\u043e\u043a \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 json \u0444\u0430\u0439\u043b\u0435, \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u0434\u0430\u043b\u0435\u0435 \u043e\u043d\u0430 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f. \u0423\u0436\u0435 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0425\u0440\u043e\u043c\u043e\u0432\u0441\u043a\u0438\u0435 \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043a\u0430\u043a \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043f\u0430\u043f\u043a\u0438 \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0441\u044b\u043b\u043a\u0438.  \u041f\u0430\u043f\u043a\u0438 \u0437\u0434\u0435\u0441\u044c \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432\u044b children, \u0430 \u0441\u0441\u044b\u043b\u043a\u0438 \u043a\u0430\u043a \u0445\u044d\u0448\u0438 \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438.<\/p>\n<p>\u0425\u0440\u043e\u043c \u0443\u043c\u0435\u0435\u0442 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0438 \u0432 \u0432\u0438\u0434\u0435 .html \u0444\u0430\u0439\u043b\u0430. \u0421\u0441\u044b\u043b\u043a\u0430 \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code>    &lt;dt&gt;&lt;a href=\"https:\/\/www.youtube.com\/watch?v=qbEPae8YNbs\" add_date=\"0\"&gt;Deep Dive on Amazon ECS - Brent Langston&lt;\/a&gt;     &lt;\/dt&gt;&lt;dt&gt;&lt;a href=\"https:\/\/aws.amazon.com\/blogs\/aws\/new-import-existing-resources-into-a-cloudformation-stack\/\" add_date=\"0\"&gt;Import Existing Resources into a CloudFormation Stack&lt;\/a&gt;<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0438\u0437 json \u0444\u0430\u0439\u043b\u0430 \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f .url \u0438 .name, \u0437\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u0445 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 .html \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u043a\u0438. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 ADD_DATE \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e.  \u0412\u043e\u0442 \u0442\u0430\u043a \u044d\u0442\u043e \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0439 \u043d\u0430\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 .json \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code>... $ jq '.roots.bookmark_bar.children[].children[] | .url, .name' Bookmarks|tail -n 4 \"http:\/\/lib.rus.ec\/b\/285485\/read\" \"\u041c\u0438\u0440 \u043c\u043d\u043e\u0433\u0438\u0445 \u043c\u0438\u0440\u043e\u0432. \u0424\u0438\u0437\u0438\u043a\u0438 \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u0438\u043d\u044b\u0445 \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u044b\u0445 (fb2) | \u041b\u0438\u0431\u0440\u0443\u0441\u0435\u043a\" \"https:\/\/picasaweb.google.com\/Dr.Anticommunij\" \"Picasa Web Albums - ophil\"<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u043c\u0435\u0441\u0442\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432 .json \u0444\u0430\u0439\u043b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 [], \u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0449\u0435\u0435 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044e \u043f\u043e \u0432\u0441\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u0418\u0434\u0451\u043c \u0434\u0430\u043b\u044c\u0448\u0435. \u0421 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u043b\u0451\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0432\u044b\u0432\u043e\u0434 \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, \u0447\u0435\u0440\u0435\u0434\u0443\u044f \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0444\u0438\u043b\u044c\u0442\u0440\u0435 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0438\u0437 \u0445\u044d\u0448\u0430:<\/p>\n<pre><code>... $ jq -jr '.roots.bookmark_bar.children[].children[] | (\"&lt;dt&gt;&lt;a href=\\\"\", .url, \"\\\"&gt;\", .name, \"&lt;\/a&gt;\\n\")' Bookmarks|tail -n 2 &lt;\/dt&gt;&lt;dt&gt;&lt;a href=\"http:\/\/lib.rus.ec\/b\/285485\/read\"&gt;\u041c\u0438\u0440 \u043c\u043d\u043e\u0433\u0438\u0445 \u043c\u0438\u0440\u043e\u0432. \u0424\u0438\u0437\u0438\u043a\u0438 \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u0438\u043d\u044b\u0445 \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u044b\u0445 (fb2) | \u041b\u0438\u0431\u0440\u0443\u0441\u0435\u043a&lt;\/a&gt; &lt;\/dt&gt;&lt;dt&gt;&lt;a href=\"https:\/\/picasaweb.google.com\/Dr.Anticommunij\"&gt;Picasa Web Albums - ophil&lt;\/a&gt;<\/code><\/pre>\n<p>\u0412\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u0432\u044b\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b 2 \u043e\u043f\u0446\u0438\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 jq:<\/p>\n<ul>\n<li>\n<p>-j &#8212;join-output &#8212; \u043d\u0435 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u0432\u044b\u0432\u043e\u0434\u0435, \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043c\u0443, \u0441\u043c. \u0441\u0438\u043c\u0432\u043e\u043b <strong>\\n<\/strong><\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>-r &#8212;raw-input &#8212; \u043d\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043a\u0430\u0432\u044b\u0447\u043a\u0438 \u043a\u0430\u043a \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445 json, \u0438\u0445 \u0441\u043d\u043e\u0432\u0430 \u0437\u0430\u0434\u0430\u044e \u0432\u0440\u0443\u0447\u043d\u0443\u044e<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0437\u0430\u043a\u043b\u0430\u0434\u043e\u043a \u043d\u0430\u0434\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u044d\u0442\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043f\u0430\u043f\u043e\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438 .children[] \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u0425\u0440\u043e\u043c\u0443 .html \u0444\u0430\u0439\u043b. \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432 \u0432 \u0425\u0440\u043e\u043c\u0435 \u043e\u0434\u043d\u0443 \u0441\u0441\u044b\u043b\u043a\u0443 \u0438 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0432 \u0432 \u0444\u0430\u0439\u043b, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 <strong>\u0434\u043e\u0431\u0430\u0432\u0438\u043c<\/strong> \u0438\u0437\u0432\u043b\u0435\u0447\u0451\u043d\u043d\u044b\u0435 \u0438\u0437 \u0441\u0442\u0430\u0440\u043e\u0433\u043e Bookmarks \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0438. \u041f\u0430\u0440\u0443 \u0441\u0442\u0440\u043e\u043a \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0441\u0430\u043c\u043e\u043c \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u0438 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u0430\u043c\u044b\u0439 \u043a\u043e\u043d\u0435\u0446:<\/p>\n<p><code>    &lt;\/DL&gt;&lt;p&gt;<\/code><\/p>\n<p><code>&lt;\/DL&gt;&lt;p&gt;  <\/code><\/p>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442 \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0432\u0441\u0435 \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0438 \u0431\u0435\u0437 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f \u043d\u0430 \u043f\u0430\u043f\u043a\u0438, \u043d\u043e \u044d\u0442\u043e \u043b\u0438\u0448\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u043e\u0432\u043e\u0434 \u043d\u0430\u0432\u0435\u0441\u0442\u0438 \u043f\u043e\u0440\u044f\u0434\u043e\u043a, \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 \u0438 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0435 \u0437\u0430\u043a\u043b\u0430\u0434\u043e\u043a \u0425\u0440\u043e\u043c\u0430 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u043f\u0440\u043e\u0436\u0438\u0442\u044b\u0445 \u043b\u0435\u0442.<\/p>\n<p>\u041c\u043e\u0449\u044c jq \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 <strong>.yaml<\/strong> \u0438 <strong>.xml<\/strong>. \u0410\u0432\u0442\u043e\u0440 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 &#171;<a href=\"https:\/\/github.com\/kislyuk\/yq\" rel=\"noopener noreferrer nofollow\">yq: Command-line YAML\/XML processor<\/a>&#187;  \u0410\u043d\u0434\u0440\u0435\u0439 \u041a\u0438\u0441\u043b\u044e\u043a \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u044d\u0442\u0438\u043c\u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u0441\u0442\u0430\u043b \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0442\u044c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434, \u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 python \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 YAML\/XML \u0432 JSON, \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u043e\u043f\u0446\u0438\u0439 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432 jq. \u041e\u0431\u0440\u0430\u0442\u043d\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 yaml \u0437\u0430\u0434\u0430\u0451\u0442\u0441\u044f \u043e\u043f\u0446\u0438\u044f\u043c\u0438 -y \u0438\u043b\u0438 -Y, \u0435\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0441\u043c. <a href=\"https:\/\/kislyuk.github.io\/yq\/\" rel=\"noopener noreferrer nofollow\">https:\/\/kislyuk.github.io\/yq\/<\/a><\/p>\n<p>\u0417\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0431\u043e\u0440\u043d\u0438\u043a \u0440\u0435\u0446\u0435\u043f\u0442\u043e\u0432 \u043d\u0430\u0448\u0451\u043b \u0443 Remy Sharp&#8217;\u0430 <a href=\"https:\/\/remysharp.com\/drafts\/jq-recipes\" rel=\"noopener noreferrer nofollow\">https:\/\/remysharp.com\/drafts\/jq-recipes<\/a>. \u041d\u0430\u0448\u0451\u043b \u0435\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u043e\u043c &#171;jq cookbook&#187;, \u043b\u0443\u0447\u0448\u0435 \u043d\u0435\u0433\u043e \u0447\u0442\u043e-\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0440\u0443\u0434\u043d\u043e. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0435\u0433\u043e \u0440\u0435\u0446\u0435\u043f\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0441\u0442\u0430\u0442\u0443\u0441 draft.<\/p>\n<p>\u041d\u0435\u043b\u044c\u0437\u044f \u043d\u0435 \u043f\u043e\u0441\u043e\u0432\u0435\u0442\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0430\u0432\u0442\u043e\u0440\u0430 <strong>jq<\/strong>  <a href=\"https:\/\/github.com\/stedolan\" rel=\"noopener noreferrer nofollow\">Stephen Dolan&#8217;\u0430<\/a>. \u041a\u0440\u043e\u043c\u0435 \u0441\u0430\u043c\u043e\u0439 <a href=\"https:\/\/stedolan.github.io\/jq\/manual\/\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>, \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0436\u0435  <a href=\"https:\/\/stedolan.github.io\/jq\/tutorial\/\" rel=\"noopener noreferrer nofollow\">tutorial<\/a>, <a href=\"https:\/\/github.com\/stedolan\/jq\/wiki\" rel=\"noopener noreferrer nofollow\">wiki<\/a>, <a href=\"https:\/\/github.com\/stedolan\/jq\/wiki\/FAQ\" rel=\"noopener noreferrer nofollow\">FAQ<\/a> \u0438 <a href=\"https:\/\/github.com\/stedolan\/jq\/wiki\/Cookbook\" rel=\"noopener noreferrer nofollow\">\u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0441\u0431\u043e\u0440\u043d\u0438\u043a \u0440\u0435\u0446\u0435\u043f\u0442\u043e\u0432<\/a>. <\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/551834\/\"> https:\/\/habr.com\/ru\/post\/551834\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><figcaption>jq intro<\/figcaption><\/figure>\n<p>\u041c\u044b \u0432\u0441\u0435 \u0438\u043d\u043e\u0433\u0434\u0430 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 JSON \u0438\u043b\u0438 YAML \u0444\u0430\u0439\u043b\u043e\u0432. \u041c\u043d\u043e\u0433\u0438\u0435 \u0443\u0436\u0435 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 \u043c\u043e\u0449\u044c\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u044b jq. \u0421\u0443\u0434\u044f \u043f\u043e \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f\u043c \u043d\u0430 \u0425\u0430\u0431\u0440\u0435, \u043d\u0430\u043f\u0440. <a href=\"https:\/\/habr.com\/ru\/post\/525808\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/post\/525808\/<\/a>, \u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c \u0432 qna, \u0442\u0435\u043c\u0430 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430.<\/p>\n<p>\u041c\u043d\u0435 \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0440\u0430\u0437 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 DSL jq \u0447\u0442\u043e\u0431\u044b \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u043d\u044b\u0435 \u0437\u0430 \u0434\u043e\u043b\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0438 \u0432 \u0425\u0440\u043e\u043c\u0435, \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0435 \u043f\u0440\u0438 \u0430\u043f\u0433\u0440\u0435\u0439\u0434\u0435. \u0422\u043e\u0447\u043d\u0435\u0435, \u0444\u0430\u0439\u043b Bookmarks \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 .json \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b\u0441\u044f, \u043d\u043e \u043d\u0438 \u0432 \u043a\u0430\u043a\u0443\u044e \u043d\u0435 \u0445\u043e\u0442\u0435\u043b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043d\u043e\u0432\u044b\u0439 \u0425\u0440\u043e\u043c. \u0425\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0440\u0435\u0446\u0435\u043f\u0442\u043e\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0437\u0430\u043e\u0434\u043d\u043e \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0442\u044c \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u043c\u0438\u043d\u0438\u0430\u0442\u044e\u0440\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u0445\u043e\u0436\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c.<\/p>\n<p>JQ \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438 &#8212; \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438, \u0442\u0438\u043f\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u043e\u0439, \u0446\u0438\u043a\u043b\u0430\u043c\u0438 \u0438 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430\u043c\u0438, \u043c\u0430\u0441\u0441\u043e\u0439 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445. \u0423\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u0441\u0451 \u044d\u0442\u043e \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043a\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 30KB, \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435\u0439 &#171;man jq&#187; \u0442\u0430\u043a\u043e\u0433\u043e \u0436\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 libjq \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 300KB.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0432 \u0432 \u0441\u0432\u043e\u0439 Bookmarks \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u043e\u0442\u043d\u044f\u043c\u0438 \u0441\u0441\u044b\u043b\u043e\u043a, \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 &#8212; \u043a\u0430\u043a\u043e\u0432\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u044d\u0442\u043e\u0433\u043e .json \u0444\u0430\u0439\u043b\u0430? \u041f\u043e \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u044f \u0443\u0436\u0435 \u0437\u043d\u0430\u043b \u043a\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e \u0435\u0451 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445. \u0412\u043e\u0442 \u044d\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430:<\/p>\n<p><code> ... $ jq '[paths|join(\".\")]' Bookmarks|head -n 16<br \/>[<br \/>       \"checksum\",<br \/>       \"roots\",<br \/>       \"roots.bookmark_bar\",<br \/>       \"roots.bookmark_bar.children\",<br \/>       \"roots.bookmark_bar.children.0\",<br \/>       \"roots.bookmark_bar.children.0.children\",<br \/>       \"roots.bookmark_bar.children.0.children.0\",<br \/>       \"roots.bookmark_bar.children.0.children.0.children\",<br \/>       \"roots.bookmark_bar.children.0.children.0.children.0\",<br \/>       \"roots.bookmark_bar.children.0.children.0.children.0.date_added\",<br \/>       \"roots.bookmark_bar.children.0.children.0.children.0.guid\",<br \/>       \"roots.bookmark_bar.children.0.children.0.children.0.id\",<br \/>       \"roots.bookmark_bar.children.0.children.0.children.0.name\",<br \/>       \"roots.bookmark_bar.children.0.children.0.children.0.type\",<br \/>       \"roots.bookmark_bar.children.0.children.0.children.0.url\",<\/code><\/p>\n<p>\u0412\u0441\u0435\u0433\u043e \u0441\u0442\u0440\u043e\u043a \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 json \u0444\u0430\u0439\u043b\u0435, \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u0434\u0430\u043b\u0435\u0435 \u043e\u043d\u0430 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f. \u0423\u0436\u0435 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0425\u0440\u043e\u043c\u043e\u0432\u0441\u043a\u0438\u0435 \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043a\u0430\u043a \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043f\u0430\u043f\u043a\u0438 \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0441\u044b\u043b\u043a\u0438.  \u041f\u0430\u043f\u043a\u0438 \u0437\u0434\u0435\u0441\u044c \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432\u044b children, \u0430 \u0441\u0441\u044b\u043b\u043a\u0438 \u043a\u0430\u043a \u0445\u044d\u0448\u0438 \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438.<\/p>\n<p>\u0425\u0440\u043e\u043c \u0443\u043c\u0435\u0435\u0442 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0438 \u0432 \u0432\u0438\u0434\u0435 .html \u0444\u0430\u0439\u043b\u0430. \u0421\u0441\u044b\u043b\u043a\u0430 \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code>    &lt;dt&gt;&lt;a href=\"https:\/\/www.youtube.com\/watch?v=qbEPae8YNbs\" add_date=\"0\"&gt;Deep Dive on Amazon ECS - Brent Langston&lt;\/a&gt;     &lt;\/dt&gt;&lt;dt&gt;&lt;a href=\"https:\/\/aws.amazon.com\/blogs\/aws\/new-import-existing-resources-into-a-cloudformation-stack\/\" add_date=\"0\"&gt;Import Existing Resources into a CloudFormation Stack&lt;\/a&gt;<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0438\u0437 json \u0444\u0430\u0439\u043b\u0430 \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f .url \u0438 .name, \u0437\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u0445 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 .html \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u043a\u0438. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 ADD_DATE \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e.  \u0412\u043e\u0442 \u0442\u0430\u043a \u044d\u0442\u043e \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0439 \u043d\u0430\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 .json \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code>... $ jq '.roots.bookmark_bar.children[].children[] | .url, .name' Bookmarks|tail -n 4 \"http:\/\/lib.rus.ec\/b\/285485\/read\" \"\u041c\u0438\u0440 \u043c\u043d\u043e\u0433\u0438\u0445 \u043c\u0438\u0440\u043e\u0432. \u0424\u0438\u0437\u0438\u043a\u0438 \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u0438\u043d\u044b\u0445 \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u044b\u0445 (fb2) | \u041b\u0438\u0431\u0440\u0443\u0441\u0435\u043a\" \"https:\/\/picasaweb.google.com\/Dr.Anticommunij\" \"Picasa Web Albums - ophil\"<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u043c\u0435\u0441\u0442\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432 .json \u0444\u0430\u0439\u043b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 [], \u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0449\u0435\u0435 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044e \u043f\u043e \u0432\u0441\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u0418\u0434\u0451\u043c \u0434\u0430\u043b\u044c\u0448\u0435. \u0421 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u043b\u0451\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0432\u044b\u0432\u043e\u0434 \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, \u0447\u0435\u0440\u0435\u0434\u0443\u044f \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0444\u0438\u043b\u044c\u0442\u0440\u0435 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0438\u0437 \u0445\u044d\u0448\u0430:<\/p>\n<pre><code>... $ jq -jr '.roots.bookmark_bar.children[].children[] | (\"&lt;dt&gt;&lt;a href=\\\"\", .url, \"\\\"&gt;\", .name, \"&lt;\/a&gt;\\n\")' Bookmarks|tail -n 2 &lt;\/dt&gt;&lt;dt&gt;&lt;a href=\"http:\/\/lib.rus.ec\/b\/285485\/read\"&gt;\u041c\u0438\u0440 \u043c\u043d\u043e\u0433\u0438\u0445 \u043c\u0438\u0440\u043e\u0432. \u0424\u0438\u0437\u0438\u043a\u0438 \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u0438\u043d\u044b\u0445 \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u044b\u0445 (fb2) | \u041b\u0438\u0431\u0440\u0443\u0441\u0435\u043a&lt;\/a&gt; &lt;\/dt&gt;&lt;dt&gt;&lt;a href=\"https:\/\/picasaweb.google.com\/Dr.Anticommunij\"&gt;Picasa Web Albums - ophil&lt;\/a&gt;<\/code><\/pre>\n<p>\u0412\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u0432\u044b\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b 2 \u043e\u043f\u0446\u0438\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 jq:<\/p>\n<ul>\n<li>\n<p>-j &#8212;join-output &#8212; \u043d\u0435 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u0432\u044b\u0432\u043e\u0434\u0435, \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043c\u0443, \u0441\u043c. \u0441\u0438\u043c\u0432\u043e\u043b <strong>\\n<\/strong><\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>-r &#8212;raw-input &#8212; \u043d\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043a\u0430\u0432\u044b\u0447\u043a\u0438 \u043a\u0430\u043a \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445 json, \u0438\u0445 \u0441\u043d\u043e\u0432\u0430 \u0437\u0430\u0434\u0430\u044e \u0432\u0440\u0443\u0447\u043d\u0443\u044e<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0437\u0430\u043a\u043b\u0430\u0434\u043e\u043a \u043d\u0430\u0434\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u044d\u0442\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043f\u0430\u043f\u043e\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438 .children[] \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u0425\u0440\u043e\u043c\u0443 .html \u0444\u0430\u0439\u043b. \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432 \u0432 \u0425\u0440\u043e\u043c\u0435 \u043e\u0434\u043d\u0443 \u0441\u0441\u044b\u043b\u043a\u0443 \u0438 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0432 \u0432 \u0444\u0430\u0439\u043b, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 <strong>\u0434\u043e\u0431\u0430\u0432\u0438\u043c<\/strong> \u0438\u0437\u0432\u043b\u0435\u0447\u0451\u043d\u043d\u044b\u0435 \u0438\u0437 \u0441\u0442\u0430\u0440\u043e\u0433\u043e Bookmarks \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0438. \u041f\u0430\u0440\u0443 \u0441\u0442\u0440\u043e\u043a \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0441\u0430\u043c\u043e\u043c \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u0438 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u0430\u043c\u044b\u0439 \u043a\u043e\u043d\u0435\u0446:<\/p>\n<p><code>    &lt;\/DL&gt;&lt;p&gt;<\/code><\/p>\n<p><code>&lt;\/DL&gt;&lt;p&gt;  <\/code><\/p>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442 \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0432\u0441\u0435 \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0438 \u0431\u0435\u0437 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f \u043d\u0430 \u043f\u0430\u043f\u043a\u0438, \u043d\u043e \u044d\u0442\u043e \u043b\u0438\u0448\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u043e\u0432\u043e\u0434 \u043d\u0430\u0432\u0435\u0441\u0442\u0438 \u043f\u043e\u0440\u044f\u0434\u043e\u043a, \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 \u0438 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0435 \u0437\u0430\u043a\u043b\u0430\u0434\u043e\u043a \u0425\u0440\u043e\u043c\u0430 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u043f\u0440\u043e\u0436\u0438\u0442\u044b\u0445 \u043b\u0435\u0442.<\/p>\n<p>\u041c\u043e\u0449\u044c jq \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 <strong>.yaml<\/strong> \u0438 <strong>.xml<\/strong>. \u0410\u0432\u0442\u043e\u0440 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 &#171;<a href=\"https:\/\/github.com\/kislyuk\/yq\" rel=\"noopener noreferrer nofollow\">yq: Command-line YAML\/XML processor<\/a>&#187;  \u0410\u043d\u0434\u0440\u0435\u0439 \u041a\u0438\u0441\u043b\u044e\u043a \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u044d\u0442\u0438\u043c\u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u0441\u0442\u0430\u043b \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0442\u044c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434, \u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 python \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 YAML\/XML \u0432 JSON, \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u043e\u043f\u0446\u0438\u0439 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432 jq. \u041e\u0431\u0440\u0430\u0442\u043d\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 yaml \u0437\u0430\u0434\u0430\u0451\u0442\u0441\u044f \u043e\u043f\u0446\u0438\u044f\u043c\u0438 -y \u0438\u043b\u0438 -Y, \u0435\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0441\u043c. <a href=\"https:\/\/kislyuk.github.io\/yq\/\" rel=\"noopener noreferrer nofollow\">https:\/\/kislyuk.github.io\/yq\/<\/a><\/p>\n<p>\u0417\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0431\u043e\u0440\u043d\u0438\u043a \u0440\u0435\u0446\u0435\u043f\u0442\u043e\u0432 \u043d\u0430\u0448\u0451\u043b \u0443 Remy Sharp&#8217;\u0430 <a href=\"https:\/\/remysharp.com\/drafts\/jq-recipes\" rel=\"noopener noreferrer nofollow\">https:\/\/remysharp.com\/drafts\/jq-recipes<\/a>. \u041d\u0430\u0448\u0451\u043b \u0435\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u043e\u043c &#171;jq cookbook&#187;, \u043b\u0443\u0447\u0448\u0435 \u043d\u0435\u0433\u043e \u0447\u0442\u043e-\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0440\u0443\u0434\u043d\u043e. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0435\u0433\u043e \u0440\u0435\u0446\u0435\u043f\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0441\u0442\u0430\u0442\u0443\u0441 draft.<\/p>\n<p>\u041d\u0435\u043b\u044c\u0437\u044f \u043d\u0435 \u043f\u043e\u0441\u043e\u0432\u0435\u0442\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0430\u0432\u0442\u043e\u0440\u0430 <strong>jq<\/strong>  <a href=\"https:\/\/github.com\/stedolan\" rel=\"noopener noreferrer nofollow\">Stephen Dolan&#8217;\u0430<\/a>. \u041a\u0440\u043e\u043c\u0435 \u0441\u0430\u043c\u043e\u0439 <a href=\"https:\/\/stedolan.github.io\/jq\/manual\/\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>, \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0436\u0435  <a href=\"https:\/\/stedolan.github.io\/jq\/tutorial\/\" rel=\"noopener noreferrer nofollow\">tutorial<\/a>, <a href=\"https:\/\/github.com\/stedolan\/jq\/wiki\" rel=\"noopener noreferrer nofollow\">wiki<\/a>, <a href=\"https:\/\/github.com\/stedolan\/jq\/wiki\/FAQ\" rel=\"noopener noreferrer nofollow\">FAQ<\/a> \u0438 <a href=\"https:\/\/github.com\/stedolan\/jq\/wiki\/Cookbook\" rel=\"noopener noreferrer nofollow\">\u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0441\u0431\u043e\u0440\u043d\u0438\u043a \u0440\u0435\u0446\u0435\u043f\u0442\u043e\u0432<\/a>. <\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/551834\/\"> https:\/\/habr.com\/ru\/post\/551834\/<\/a><br \/><\/br><\/br><\/br><\/br><\/br><\/br><\/br><\/br><\/br><\/br><\/br><\/br><\/br><\/br><\/br><\/code><\/p>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-321417","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/321417","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=321417"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/321417\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=321417"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=321417"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=321417"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}