
Ao executar o comando:
cellprofiler --get-batch-commands "/users/pmrotem/CellProfiler/example_project/output/Batch_data5_8.h5"
no shell, recebo uma saída:
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
No entanto, quando tento enviá-lo para um arquivo (adiciono >test.txt
), recebo um arquivo vazio. Também tentei invocar o comando através de python e também obter stdout vazio. stderr também está vazio em ambos os casos.
Qual é o problema? alguma ideia?
Responder1
Alguns programas se comportam de maneira diferente quando estão conectados a um terminal e quando não estão (veja oisatty
função). Para fazer o aplicativo pensar que está conectado a um terminal, você pode tentar script -c
:
script -c cellprofiler --get-batch-commands \
"/users/pmrotem/CellProfiler/example_project/output/Batch_data5_8.h5" \
>test.txt