문제

When one does

process > file

Standard output gets written to a file only once the process is over. Is there a way to write it right away?

Namely, I'm doing batch conversion odt2pdf with:

libreoffice --convert-to pdf:writer_pdf_Export *.odt

So libreoffice says about which files are processed right away. But when I do:

libreoffice --convert-to pdf:writer_pdf_Export *.odt > log

The information is written only once I close libreoffice. (I want to read the number of lines in the log - and this way I'll kill libreoffice when all files are processed)

Edit:

I found a command line option of libreoffice which I misunderstood at first: --invisible - so it will kill itself after what it has to do - so I don't need to kill it myself - hence no problem any more.

도움이 되었습니까?

해결책

try

unbuffer libreoffice --convert-to pdf:writer_pdf_Export *.odt > log

Note to general readers, unbuffer is not always available as a std binary in old-style Unix platforms and may require a search and installation for a package to support it.

Also note that O.P. @Adobe found that libreoffice has an --invisible option that solved the issue, i.e.

libreoffice --invisible --convert-to pdf:writer_pdf_Export *.odt > log

I hope this helps.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top