
При выполнении команды:
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