擅长:python、mysql、java
<p>我想你想要的是:</p>
<pre><code>python test.py <( hadoop fs -cat inputfile.txt ) <streamingfile.txt
</code></pre>
<p>在bash中,<code><( ... )</code>是<a href="http://www.gnu.org/software/bash/manual/bashref.html#Process-Substitution" rel="nofollow">Process Substitution</a>。圆括号内的命令在其输出连接到fifo或等效对象的情况下运行,并将fifo的名称(或<code>/dev/fd/n</code>如果bash能够使用未命名的管道)替换为参数。该工具会看到一个文件名,它可以打开并正常使用。(<code>>(...)</code>也可用,输入连接到fifo,以防需要命名的流式输出。)</p>