
다음 명령을 실행할 때:
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