<div dir="ltr"><div dir="ltr"><div dir="ltr" class="gmail_attr">On Sat, Jan 28, 2023 at 1:22 AM Michael Homscheidt wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I use rsync with the option --out-format '%o %n‘ but want to have the contents of the mesages to be overwritten.</blockquote><div> </div></div><div dir="ltr">You can't make rsync do that directly, but you can filter the output.  For instance, the following python3 script runs rsync with an --out-format that starts with "<>" and filters the combined stdout + stderr output, putting repeated "<>" lines over the top of each other (using ANSII reverse-index & clear-to-EOL escape sequences). It also allows error/info lines to remain visible: they do not overwrite the prior merged line and a new merged line starts below it. If a line is too long to fit on a single terminal line then there will be some downward movement, but that could be improved should you desire to do so.<div><br></div><div>Name this script something like "solo-rsync":<div><br></div><div><font face="monospace">#!/usr/bin/python3<br>import sys, subprocess                                                                                                         rsync = subprocess.Popen(<br>        ['rsync', '--outbuf=line',<br>            '--out-format=<>%o %n',<br>            *sys.argv[1:]],<br>        stdout=subprocess.PIPE, stderr=subprocess.STDOUT,<br>        encoding='UTF-8')<br>folding = False<br>for line in rsync.stdout:<br>    if line.startswith('<>'):<br>        if folding:<br>            print("\033[A" + line[2:].rstrip("\n") + "\033[K")<br>        else:<br>            print(line[2:], end='')<br>            folding = True<br>    else:<br>        print(line, end='')<br>        folding = False</font></div><div><font face="monospace">    sys.stdout.flush()</font><br></div><div><div><div dir="ltr" class="gmail_signature"><br></div><div dir="ltr" class="gmail_signature">..wayne..</div></div></div></div></div></div>