標準出力が空です。

標準出力が空です。

コマンドを実行するとき:

cellprofiler --get-batch-commands "/users/pmrotem/CellProfiler/example_project/output/Batch_data5_8.h5"

シェルから次のような出力を取得します。

CellProfiler -c -r -b -p /users/pmrotem/CellProfiler/example_project/output/Batch_data5_8.h5 -g Metadata_Plate=20140602-LOPAC pilot_Assay Plate 0_5
CellProfiler -c -r -b -p /users/pmrotem/CellProfiler/example_project/output/Batch_data5_8.h5 -g Metadata_Plate=20140602-LOPAC pilot_Assay Plate 0_6
CellProfiler -c -r -b -p /users/pmrotem/CellProfiler/example_project/output/Batch_data5_8.h5 -g Metadata_Plate=20140602-LOPAC pilot_Assay Plate 0_7
CellProfiler -c -r -b -p /users/pmrotem/CellProfiler/example_project/output/Batch_data5_8.h5 -g Metadata_Plate=20140602-LOPAC pilot_Assay Plate 0_8

ただし、ファイル(私が追加したもの)として出力しようとすると、空の>test.txtファイルが生成されます。また、Python経由でコマンドを呼び出してみましたが、空のstdoutを取得しました。どちらの場合も、stderrも空です。

問題は何ですか?どんなアイデアがありますか?

ベストアンサー1

一部のプログラムは、端末に接続されているときと接続されていないときは異なる動作をします(参照:isatty機能)。アプリケーションが端末に接続されていると思うようにするには、以下を試してくださいscript -c

script -c cellprofiler --get-batch-commands \
 "/users/pmrotem/CellProfiler/example_project/output/Batch_data5_8.h5" \
  >test.txt

おすすめ記事