<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: 重定向 Bash &#8220;time&#8221; 命令的输出</title>
	<atom:link href="http://9rivers.linkka.com/2009/12/16/%e9%87%8d%e5%ae%9a%e5%90%91-bash-time-%e5%91%bd%e4%bb%a4%e7%9a%84%e8%be%93%e5%87%ba/feed/" rel="self" type="application/rss+xml" />
	<link>http://9rivers.linkka.com/2009/12/16/%e9%87%8d%e5%ae%9a%e5%90%91-bash-time-%e5%91%bd%e4%bb%a4%e7%9a%84%e8%be%93%e5%87%ba/</link>
	<description>Molecular modeling in Materials Sciences Web development Programming IT</description>
	<lastBuildDate>Mon, 20 Jun 2011 09:37:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: 9rivers</title>
		<link>http://9rivers.linkka.com/2009/12/16/%e9%87%8d%e5%ae%9a%e5%90%91-bash-time-%e5%91%bd%e4%bb%a4%e7%9a%84%e8%be%93%e5%87%ba/comment-page-1/#comment-450</link>
		<dc:creator>9rivers</dc:creator>
		<pubDate>Tue, 13 Jul 2010 18:24:31 +0000</pubDate>
		<guid isPermaLink="false">http://9rivers.linkka.com/?p=306#comment-450</guid>
		<description>OYU，谢谢你的评论！

不过有什么理由认为time是执行在子shell的呢？我认为time还是在当前shell执行，只是它的输出被送到当前shell的自身的标准IO（或者说是上级shell的标准IO）而不是为子进程准备的标准IO。这样当前shell不能捕捉其输出，而父shell总是可以。而command则总是使用当前shell准备好的标准文件描述符。

上面的理解有参考也有我自己的理解，不切实之处欢迎指出。
参考：http://mywiki.wooledge.org/BashFAQ/032</description>
		<content:encoded><![CDATA[<p>OYU，谢谢你的评论！</p>
<p>不过有什么理由认为time是执行在子shell的呢？我认为time还是在当前shell执行，只是它的输出被送到当前shell的自身的标准IO（或者说是上级shell的标准IO）而不是为子进程准备的标准IO。这样当前shell不能捕捉其输出，而父shell总是可以。而command则总是使用当前shell准备好的标准文件描述符。</p>
<p>上面的理解有参考也有我自己的理解，不切实之处欢迎指出。<br />
参考：http://mywiki.wooledge.org/BashFAQ/032</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 0YU</title>
		<link>http://9rivers.linkka.com/2009/12/16/%e9%87%8d%e5%ae%9a%e5%90%91-bash-time-%e5%91%bd%e4%bb%a4%e7%9a%84%e8%be%93%e5%87%ba/comment-page-1/#comment-449</link>
		<dc:creator>0YU</dc:creator>
		<pubDate>Tue, 13 Jul 2010 14:53:22 +0000</pubDate>
		<guid isPermaLink="false">http://9rivers.linkka.com/?p=306#comment-449</guid>
		<description>我觉得你有个地方说反了(time是subshell,command是当前shell),我上网查了下.应该是:
command是运行在当前shell的,time由于是shell的关键字(which time没有输出)而永远是在subshell进程运行.
这才能解释time command 2&gt; file.txt无效是因为重定向的是当前shell(command)的standard error</description>
		<content:encoded><![CDATA[<p>我觉得你有个地方说反了(time是subshell,command是当前shell),我上网查了下.应该是:<br />
command是运行在当前shell的,time由于是shell的关键字(which time没有输出)而永远是在subshell进程运行.<br />
这才能解释time command 2&gt; file.txt无效是因为重定向的是当前shell(command)的standard error</p>
]]></content:encoded>
	</item>
</channel>
</rss>

