
{"id":807,"date":"2010-02-10T00:27:04","date_gmt":"2010-02-09T18:57:04","guid":{"rendered":"http:\/\/froisa.com\/?p=807"},"modified":"2010-02-10T00:27:04","modified_gmt":"2010-02-09T18:57:04","slug":"re-bash-question-get-output-as-a-variable","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2010\/02\/10\/re-bash-question-get-output-as-a-variable\/","title":{"rendered":"Re: Bash question: get output as a variable?"},"content":{"rendered":"<p>On Fri, Feb 05, 2010 at 09:01:45AM -0700, Paul E Condon wrote:<br \/>\n On 20100205_135919, Alexey Salmin wrote:<br \/>\n  On Fri, Feb 5, 2010 at 1:20 PM, Javier Barroso  wrote:<br \/>\n   On Fri, Feb 5, 2010 at 1:06 AM, Stephen Powell  wrote:<br \/>\n &gt; &gt;&gt; On Thu, 4 Feb 2010 17:42:45 -0500 (EST), Javier Barroso wrote:<br \/>\n &gt; &gt;&gt;&gt; In this case output goes to stderr, so:<br \/>\n &gt; &gt;&gt;&gt;<br \/>\n &gt; &gt;&gt;&gt; tar -zcvf &#8211; * &#8211;exclude-from $EXCLUDES 2&gt; \/tmp\/data$$ | openssl &#8230;<br \/>\n &gt; &gt;&gt;<br \/>\n &gt; &gt;&gt; Is that something you just have to find out by trial and error?<br \/>\n &gt; &gt;&gt; I checked the man page for tar, and there&#8217;s nothing in there about<br \/>\n &gt; &gt;&gt; the -v output being written to stderr. ?I&#8217;ll take your word for it,<br \/>\n &gt; &gt;&gt; but in the general case, it&#8217;s hard to tell. ?Since stdout and<br \/>\n &gt; &gt;&gt; stderr both default to the terminal, and since the doc doesn&#8217;t<br \/>\n &gt; &gt;&gt; say, how else would you know other than by trial and error?<br \/>\n &gt; &gt; If you are using stdout as tar output, including filenames there will<br \/>\n &gt; &gt; corrupt that output, so it is logical that in this case filenames goes<br \/>\n &gt; &gt; to stderr.<br \/>\n &gt; &gt;<br \/>\n &gt; &gt; Sorry my bad english, I hope you understand my opinion<br \/>\n &gt; &gt;<br \/>\n &gt;<br \/>\n &gt; That&#8217;s true: programs using stdout for data output certainly have to<br \/>\n &gt; use stderr as a way to report any additional info.<br \/>\n &gt;<br \/>\n &gt; Alexey<\/p>\n<p> A comment towards &#8216;how would I know&#8217;:<\/p>\n<p> Traditional Unix and traditional C both made provision for stdin,<br \/>\n stdout, and stderr. When Stroustrup, et al., started working on C++<br \/>\n and its earlier predicessors, someone recognized the need for a fourth<br \/>\n stdXXX, namely stdlog.  I think it was\/is a good idea, but it has<br \/>\n never gained enough traction to justify all the changes that would be<br \/>\n required if it were introduced into the POSIX standard. Instead, the<br \/>\n community has kept the name stderr, but changed the usage to something<br \/>\n that might better be named stdmsg, indicating both errors and action<br \/>\n logging. Its the sort of historical development that doesn&#8217;t get recorded<br \/>\n in any man page (or at least any man page that newbies know about).<\/p>\n<p> HTH<br \/>\n &#8212;<br \/>\n Paul E Condon<br \/>\n pecondon@mesanetworks.net<\/p>\n<p> &#8212;<br \/>\n To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org<br \/>\n with a subject of &#8220;unsubscribe&#8221;. Trouble? Contact listmaster@lists.debian.org<\/p>\n","protected":false},"excerpt":{"rendered":"<p>On Fri, Feb 05, 2010 at 09:01:45AM -0700, Paul E Condon wrote: On 20100205_135919, Alexey Salmin wrote: On Fri, Feb 5, 2010 at 1:20 PM, Javier Barroso wrote: On Fri, Feb 5, 2010 at 1:06 AM, Stephen Powell wrote: &gt; &gt;&gt; On Thu, 4 Feb 2010 17:42:45 -0500 (EST), Javier Barroso wrote: &gt; &gt;&gt;&gt; In &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2010\/02\/10\/re-bash-question-get-output-as-a-variable\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Re: Bash question: get output as a variable?&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[1253,1347],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/807"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=807"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/807\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=807"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=807"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=807"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}