
Cuando ejecuta el comando:
cellprofiler --get-batch-commands "/users/pmrotem/CellProfiler/example_project/output/Batch_data5_8.h5"
en el shell, obtengo un resultado:
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
Sin embargo, cuando intento enviarlo a un archivo (agrego >test.txt
), obtengo un archivo vacío. También intenté invocar el comando a través de Python y también obtuve una salida estándar vacía. stderr también está vacío en ambos casos.
¿Cuál es el problema? ¿algunas ideas?
Respuesta1
Algunos programas se comportan de forma diferente cuando están conectados a un terminal que cuando no lo están (consulte la secciónisatty
función). Para que la aplicación piense que está conectada a un terminal, puedes intentar script -c
:
script -c cellprofiler --get-batch-commands \
"/users/pmrotem/CellProfiler/example_project/output/Batch_data5_8.h5" \
>test.txt