There is a log file that is updated every second, you need to copy the last line from it periodically, the output to the terminal is obtained, I do this:

cat /tmp/ffmpeg-log.log | tail -n 1 

One, the last line is displayed, but when you need to copy this line into another file, I do this:

 cat /tmp/ffmpeg-log.log | tail -n 1 > ffmpeg.txt 

so in this ffmpeg.txt file lines 50-60 are copied, or even more, tell me how to copy one, the last line correctly.

  • can echo 'cat /tmp/ffmpeg-log.log | tail -n 1' >> ffmpeg.txt echo 'cat /tmp/ffmpeg-log.log | tail -n 1' >> ffmpeg.txt ? Replace only regular quotes with - Mr. Brightside
  • everything is correct, and your code and mine, the problem was in the file itself. - Stas
  • @ Mr.Brightside, the typical useless use of cat . - 0andriy
  • @AndyShevchenko echo 'tail -n 1 < /tmp/ffmpeg-log.log' >> ffmpeg.txt - and now? - Mr. Brightside
  • one
    @AndyShevchenko Yes, thank you, I have already read. It is useful, I admit. - Mr. Brightside

0