2月 072018
 

<($cmd) 可以模拟类似协程的效果,如下:

当然,效果上虽然和走管道类似,但是如果程序不支持读标准输入的话,这也不失为一种不错的替代;  当然,这个也可以用于标准输入的重定向:

这两种写法只差一个 < ,后者是shell直接帮做了标准输入的重定向,前者没有做标准输入的重定向,只是向打开普通文件一样的方式打开了bash帮忙生成的一个临时文件。

 

这种语法 叫做Process Substitution

 Posted by at 下午 5:17

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

(required)

(required)

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据