{"id":912,"date":"2021-05-24T19:54:42","date_gmt":"2021-05-25T02:54:42","guid":{"rendered":"https:\/\/gantovnik.com\/bio-tips\/?p=912"},"modified":"2021-05-24T19:54:42","modified_gmt":"2021-05-25T02:54:42","slug":"165-cowsay","status":"publish","type":"post","link":"https:\/\/gantovnik.com\/bio-tips\/2021\/05\/165-cowsay\/","title":{"rendered":"#165 Cowsay"},"content":{"rendered":"<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\necho 'Hello!' | cowsay -f tux\r\n<\/pre>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2021\/05\/ex165.png?resize=146%2C202&#038;ssl=1\" alt=\"\" width=\"146\" height=\"202\" class=\"alignnone size-full wp-image-913\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>echo &#8216;Hello!&#8217; | cowsay -f tux<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","_lmt_disableupdate":"yes","_lmt_disable":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[8,20],"tags":[],"class_list":["post-912","post","type-post","status-publish","format-standard","hentry","category-bash","category-linux"],"modified_by":"gantovnik","jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8bH0k-eI","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":867,"url":"https:\/\/gantovnik.com\/bio-tips\/2021\/02\/156-filtering-content-from-files-using-awk\/","url_meta":{"origin":912,"position":0},"title":"#156 Filtering content from files using awk","author":"gantovnik","date":"2021-02-09","format":false,"excerpt":"#156 Displaying and filtering the content of files with awk Using the following command, we can print all lines from the file: [code language=\"python\"] awk ' { print } ' \/etc\/passwd [\/code] This is equivalent to using the $0 variable. The $0 variables refers to the complete line. [code language=\"python\"]\u2026","rel":"","context":"In &quot;awk&quot;","block_context":{"text":"awk","link":"https:\/\/gantovnik.com\/bio-tips\/category\/awk\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1964,"url":"https:\/\/gantovnik.com\/bio-tips\/2023\/09\/392-pipeline-in-bash-to-obtain-ratio-between-euro-and-usd\/","url_meta":{"origin":912,"position":1},"title":"#392 Pipeline in bash to obtain ratio between Euro and USD","author":"gantovnik","date":"2023-09-18","format":false,"excerpt":"Pipeline in bash to obtain ratio between Euro and USD: to run in Ubuntu: [code language=\"python\"] chmod a+x ex392.txt .\/ex392.txt [\/code] ex392.txt [code language=\"python\"] echo \"min Euro\/USD:\" curl -s https:\/\/www.ecb.europa.eu\/stats\/eurofxref\/eurofxref-hist.zip | gunzip \\ | sqlite3 -csv ':memory:' '.import \/dev\/stdin stdin' \"select Date, USD from stdin order by USD asc limit\u2026","rel":"","context":"In &quot;bash&quot;","block_context":{"text":"bash","link":"https:\/\/gantovnik.com\/bio-tips\/category\/bash\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":900,"url":"https:\/\/gantovnik.com\/bio-tips\/2021\/02\/162-loops-using-command-line-in-bash\/","url_meta":{"origin":912,"position":2},"title":"#162 Loops using command line in bash","author":"gantovnik","date":"2021-02-19","format":false,"excerpt":"With increment: [code language=\"python\"] $ for i in {1..20..2}; do echo $i; done [\/code] Output: [code language=\"python\"] 1 3 5 7 9 11 13 15 17 19 [\/code] [code language=\"python\"] $ for word in one two three; do echo $word; done [\/code] Output: [code language=\"python\"] one two three [\/code] C-like\u2026","rel":"","context":"In &quot;bash&quot;","block_context":{"text":"bash","link":"https:\/\/gantovnik.com\/bio-tips\/category\/bash\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":544,"url":"https:\/\/gantovnik.com\/bio-tips\/2020\/05\/how-to-write-a-code-to-know-certain-elements-belongs-to-which-components\/","url_meta":{"origin":912,"position":3},"title":"How to write a code to know certain elements belongs to which components ?","author":"gantovnik","date":"2020-05-12","format":false,"excerpt":"How to write a code to know certain elements belongs to which components ? set comp_id [hm_getvalue elems id=$elem_id dataname=collector.id]","rel":"","context":"In &quot;python&quot;","block_context":{"text":"python","link":"https:\/\/gantovnik.com\/bio-tips\/category\/python\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":890,"url":"https:\/\/gantovnik.com\/bio-tips\/2021\/02\/158-filtering-content-from-files-based-on-field-value-using-awk\/","url_meta":{"origin":912,"position":4},"title":"#158 Filtering content from files based on field value using awk","author":"gantovnik","date":"2021-02-09","format":false,"excerpt":"#158 Filtering content from files based on field value using awk Request to print lines which has value in field #3 larger than 999: [code language=\"python\"] awk -F\":\" '$3 > 999 ' \/etc\/passwd [\/code] Request to print lines which has value in field #3 smaller than 101: [code language=\"python\"] awk\u2026","rel":"","context":"In &quot;awk&quot;","block_context":{"text":"awk","link":"https:\/\/gantovnik.com\/bio-tips\/category\/awk\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":892,"url":"https:\/\/gantovnik.com\/bio-tips\/2021\/02\/159-awk-control-file\/","url_meta":{"origin":912,"position":5},"title":"#159 Awk control file","author":"gantovnik","date":"2021-02-09","format":false,"excerpt":"#159 Awk control file Create awk control file func1.awk [code language=\"python\"] function green(s) { printf \"\\033[1;32m\" s \"\\033[0m\\n\" } BEGIN { FS=\":\" green(\" Name: UID: Shell:\") } { printf \"%10s %4d %17s\\n\",$1,$3,$7 } [\/code] Command to run awk control file is [code language=\"python\"] awk -f func1.awk \/etc\/passwd [\/code]","rel":"","context":"In &quot;awk&quot;","block_context":{"text":"awk","link":"https:\/\/gantovnik.com\/bio-tips\/category\/awk\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/912","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/comments?post=912"}],"version-history":[{"count":0,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/912\/revisions"}],"wp:attachment":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/media?parent=912"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/categories?post=912"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/tags?post=912"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}