{"id":199,"date":"2013-08-20T21:20:27","date_gmt":"2013-08-20T21:20:27","guid":{"rendered":"http:\/\/www.notnull.ro\/log\/?p=199"},"modified":"2013-08-20T21:54:30","modified_gmt":"2013-08-20T21:54:30","slug":"tcsh-how-to-redirect-stdout-stderr-to-different-files","status":"publish","type":"post","link":"https:\/\/notnull.ro\/log\/tcsh-how-to-redirect-stdout-stderr-to-different-files\/","title":{"rendered":"tcsh &#8211; how to redirect stdout stderr to different files"},"content":{"rendered":"<p>One of the most <em>difficult<\/em> task to do in <strong>tcsh<\/strong> is to\u00a0 redirect the stdout and stderr into separated files. I&#8217;m not doing this very often, and because of this I always forget how to do it. Every time when I need to do such a thing I spend tens of minutes trying different combination and reading man\/internet pages.<\/p>\n<p>On other shells like <strong>bash <\/strong>it is straight forward: <strong>my_command &gt; out.txt 2&gt; err.txt\u00a0 <\/strong>. Such a thing will not work in tcsh, but hey the things are not so complicated. You just have to do <strong>(my_command &gt; out.txt ) &gt;&amp; err.txt <\/strong>. Even more, if you want to redirect only the stderr to a file , and want to see what is originally printed on stdout you can do like this: <strong>(my_command &gt; \/dev\/tty ) &gt;&amp; err.txt<\/strong><\/p>\n<p>Hope that the trick is useful for other visitors who came to this page.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the most difficult task to do in tcsh is to\u00a0 redirect the stdout and stderr into separated files. I&#8217;m not doing this very often, and because of this I always forget how to do it. Every time when I need to do such a thing I spend tens of minutes trying different combination <a href='https:\/\/notnull.ro\/log\/tcsh-how-to-redirect-stdout-stderr-to-different-files\/' class='excerpt-more'>&#8230; Read Full Article<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,17,7],"tags":[49,53,54,14,52,50,51,48],"class_list":["post-199","post","type-post","status-publish","format-standard","hentry","category-linux","category-shells","category-unix","tag-bash","tag-different","tag-files","tag-linux-2","tag-separated","tag-stderr","tag-stdout","tag-tcsh","category-8-id","category-17-id","category-7-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/posts\/199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/comments?post=199"}],"version-history":[{"count":3,"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/posts\/199\/revisions"}],"predecessor-version":[{"id":202,"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/posts\/199\/revisions\/202"}],"wp:attachment":[{"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/media?parent=199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/categories?post=199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/tags?post=199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}