I run a program that generates a line of output every second. Each time a new line is generated I need to save it (and only it) into a particular text file. When a new line is generated the file must be overwritten with the new line.
I think it must be very simple solution but I can’t figure it out using my poor knowledge of the shell commands.
Thanks!
Something like this would be one possible solution
where
$fileis your file.