bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Keep bash output to one line


From: Paul Jarc
Subject: Re: Keep bash output to one line
Date: Fri, 26 Sep 2008 00:39:08 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

mikehershey32 <mikehershey32@gmail.com> wrote:
> Is there a way that i can make new output to the file overwrite the
> old file content without stopping the program and restarting the script or
> rotating the log file?

{
  python -c '
import os
import time
while True:
  time.sleep(1)
  os.lseek(1, 0, 0)
' &
  btlaunchmany.py
} > output-file

Here, python and btlaunchmany.py both inherit the same file descriptor
from a single shell redirection, which means they share the file
position - changing it in one affects the other.


paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]