
次のコマンドを実行します:
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