スクリプトの出力を別のプログラムにパイプしたい。私が通常これらの2つの形式を使用して行うこと:
python test.py 2>&1 | pyrg
python test.py |& pyrg
私の問題は、makefile内からは機能しないことです。
[Makefile]
test:
python test.py 2>&1 | pyrg [doesn't work]
作業を行うスクリプトファイルを作成することは避けたいと思います。
編集:
これは問題のようですpyrg
:
python test.py 2>&1 | tee test.out // Writes to the file both stderr and stdout
cat test.out | pyrg // Works fine!
python test.py 2>&1 | pyrg // pyrg behaves as if it got no input
テストが失敗した場合にその部分に到達することは決してないので、これは私にとって悪い解決策ですcat
(すべてがMakefileルール内にあります)