{"id":542,"date":"2019-12-29T14:11:17","date_gmt":"2019-12-29T14:11:17","guid":{"rendered":"http:\/\/labiol.xyz\/?p=542"},"modified":"2019-12-29T14:12:45","modified_gmt":"2019-12-29T14:12:45","slug":"awk-kilka-przydatnych-polecen","status":"publish","type":"post","link":"https:\/\/www.labiol.xyz\/index.php\/2019\/12\/29\/awk-kilka-przydatnych-polecen\/","title":{"rendered":"AWK, kilka przydatnych polece\u0144."},"content":{"rendered":"\n<p>AWK jest bardzo przydatnym programem (a w\u0142a\u015bciwie j\u0119zykiem programowania). Ale u\u017cywane rzadko, z uwagi na swoj\u0105 specyficzn\u0105 sk\u0142adnie jest trudne w u\u017cyciu.<\/p>\n\n\n\n<p>Poniej kilka przyk\u0142ad\u00f3w wykorzystania tego polecenia:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><code>history | awk -v f=1 -v t=3 '{for(i=1;i&lt;=NF;i++)if(i&gt;=f&amp;&amp;i&lt;=t)continue;else printf(\"%s%s\",$i,(i!=NF)?OFS:ORS)}'<\/code><\/p><cite>pokazuje tylko polecenia historii bash, bez wypisywania daty i godziny<\/cite><\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><code>awk '{print $1 $2}' FILE<\/code><\/p><cite>poka\u017c pierwsz\u0105 i drug\u0105 kolumn\u0119<\/cite><\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><code>awk '{print $NF}' FILE<\/code><\/p><cite>poka\u017c ostatni\u0105 kolumn\u0119 pliku<\/cite><\/blockquote>\n\n\n\n<p><a href=\"https:\/\/www.shellhacks.com\/awk-print-column-change-field-separator-linux-bash\/\">https:\/\/www.shellhacks.com\/awk-print-column-change-field-separator-linux-bash\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>AWK jest bardzo przydatnym programem (a w\u0142a\u015bciwie j\u0119zykiem programowania). Ale u\u017cywane rzadko, z uwagi na swoj\u0105 specyficzn\u0105 sk\u0142adnie jest trudne w u\u017cyciu. Poniej kilka przyk\u0142ad\u00f3w wykorzystania tego polecenia: history | awk -v f=1 -v t=3 &#8216;{for(i=1;i&lt;=NF;i++)if(i&gt;=f&amp;&amp;i&lt;=t)continue;else printf(&#8220;%s%s&#8221;,$i,(i!=NF)?OFS:ORS)}&#8217; pokazuje tylko polecenia historii bash, bez wypisywania daty i godziny awk &#8216;{print $1 &hellip; <\/p>\n","protected":false},"author":1,"featured_media":515,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3,2],"tags":[],"class_list":["post-542","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-freebsd","category-linux","category-vmware"],"_links":{"self":[{"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/posts\/542","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=542"}],"version-history":[{"count":3,"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/posts\/542\/revisions"}],"predecessor-version":[{"id":546,"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/posts\/542\/revisions\/546"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/media\/515"}],"wp:attachment":[{"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=542"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=542"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}