我最近在python中做了相当多的工作,并希望能够使用它的功能而不是shell/bash内置/ shell脚本.
所以对于像这样的shell管道:
echo -e "Line One\nLine Two\nLine Three" | (cat<<-HERE | python
import sys
print 'stdout hi'
for line in sys.stdin.readlines():
print ('stdout hi on line: %s\n' %line)
HERE
) | tee -a tee.out
Run Code Online (Sandbox Code Playgroud)
所有打印的都是"stdout hi"
需要修复什么?
谢谢!