我最近在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
打印的全部是“ stdout hi”
这里需要解决什么?
DIEA
相关分类