{"id":2520,"date":"2009-11-10T21:25:00","date_gmt":"2009-11-10T21:25:00","guid":{"rendered":"http:\/\/www.b.shuttle.de\/hayek\/Hayek\/Jochen\/wp\/blog-en\/2009\/11\/10\/how-to-use-unix-tee-to-send-output-to-more-than-one-pipe\/"},"modified":"2009-11-10T21:25:00","modified_gmt":"2009-11-10T21:25:00","slug":"how-to-use-unix-tee-to-send-output-to-more-than-one-pipe","status":"publish","type":"post","link":"https:\/\/wp.jochen.hayek.name\/blog-en\/2009\/11\/10\/how-to-use-unix-tee-to-send-output-to-more-than-one-pipe\/","title":{"rendered":"how to use UNIX tee to send output to more than one pipe?"},"content":{"rendered":"<p>\t\t\t\tI have a necessity for that usage, I googled for it, found an answer <a href=\"http:\/\/www.unix.com\/shell-programming-scripting\/104588-how-unix-tee-send-pipeline-output-2-pipes.html\">here on UNIX.com<\/a>, but I thought, there might be something slicker. I got myself an account there in order to tell the initiator of that thread, what I am going to find out, but sadly enough, he got banned since. That doesn&#8217;t happen too rarely.<\/p>\n<p>I like UNIX man pages, and I thought, I should give &#8220;<i>$ man 1 tee<\/i>&#8221; a try. That pointed me to &#8220;<i>$ info coreutils &#8216;tee invocation<\/i>&#8216;&#8221;, and that instructed me to use &#8220;<i>process substitution<\/i>&#8220;, a feature of modern shells. The notation is different, but it&#8217;s still <i><a href=\"http:\/\/en.wikipedia.org\/wiki\/Pipe_%28Unix%29\">piping<\/a><\/i>: &#8220;<i>&gt;( PROCESS_READING_FROM_A_PIPE )<\/i>&#8220;. And you can use it more than once on the process, that you want to read output from.<\/p>\n<p>Now, that is seriously slick enough for me. Read the example there, it&#8217;s really nice!<\/p>\n<p>Added a note on <a href=\"http:\/\/en.wikipedia.org\/wiki\/Tee_%28command%29\">en.wikipedia.org<\/a> mentioning this insight. <\/p>\n<p>It is rather tempting to think, that using <i>process substitution<\/i> you don&#8217;t even need <i>tee<\/i> itself anymore at all, but just try yourself, it doesn&#8217;t work!\t\t\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a necessity for that usage, I googled for it, found an answer here on UNIX.com, but I thought, there might be something slicker. I got myself an account there in order to tell the initiator of that thread, what I am going to find out, but sadly enough, he got banned since. That [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","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":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_share_on_mastodon":"0"},"categories":[666],"tags":[],"class_list":["post-2520","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paO0kP-EE","jetpack_likes_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/2520","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/comments?post=2520"}],"version-history":[{"count":0,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/2520\/revisions"}],"wp:attachment":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/media?parent=2520"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/categories?post=2520"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/tags?post=2520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}