Zsh Mailing List Archive
Messages sorted by:
Re: freebsd problems with carriage return
- X-seq: zsh-users 13965
- From: "Benjamin R. Haskell" <zsh@xxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxxxxx>
- Subject: Re: freebsd problems with carriage return
- Date: Wed, 25 Mar 2009 04:18:51 -0400 (EDT)
- In-reply-to: <20090324213624.93603.qmail@xxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20090324101411.66890.qmail@xxxxxxxxxxx> <chaz20090324114727.GA5144@xxxxxxxxxxx> <20090324213624.93603.qmail@xxxxxxxxxxx>
On Wed, 25 Mar 2009, Atom Smasher wrote:
> On Tue, 24 Mar 2009, Stephane Chazelas wrote:
> > [...]
> > rsync --progress /from /to | sed -n l
> > (or od -c)
> > to see what rsync actually outputs.
> or this:
> % rsync --progress -h --bwlimit=5 ./foo_in ./foo_out > test
> % cat -vet test
> 32.77K 0% 0.00kB/s 0:00:00^M 65.54K 0% 5.00kB/s
> 0:49:49^M 98.30K 0% 5.00kB/s 0:49:42^M 131.07K 0% 5.00kB/s
> 0:49:36^M 163.84K 1% 5.00kB/s 0:49:29^M 196.61K 1% 5.00kB/s
> 0:49:22^M 229.38K 1% 5.00kB/s 0:49:16^M 262.14K 1% 5.00kB/s
> 0:49:09^M 294.91K 1% 5.00kB/s 0:49:03^M 327.68K 2% 5.00kB/s
> 0:48:56^M 360.45K 2% 5.00kB/s 0:48:50^M 393.22K 2% 5.00kB/s
> 0:48:43^M 425.98K 2% 5.00kB/s 0:48:36^M 458.75K 3% 5.00kB/s
> 0:48:30^M 491.52K 3% 5.00kB/s 0:48:24^M
> all of rsync's output of interest is stdout. it's mostly a bunch of progress
> updates, separated by carriage returns.
I think it's a difference in how FreeBSD and Linux handle some
tty/job-control settings. (Though it's not terribly surprising to me...
one of those "I'm going to behave differently when you pipe me" things.)
I assume your ultimate goal isn't to prepend 'foo' to each of those lines.
What are you trying to do?
On FreeBSD for me, the status updates are visible when not piped (either
displayed to terminal, or redirected to a file). But, rsync --progress
from to | cat -v only shows the final status.
I noticed in the rsync code (progress.c) that it declines to print the
partial status lines (the ones that end with '\r' so that they can be
overwritten) depending on the outcome of:
210 tc_pgrp = tcgetpgrp(STDOUT_FILENO);
211 if (tc_pgrp != pgrp && tc_pgrp != -1)
I'm probably only noticing this because I just read:
"The TTY demystified"
Maybe something in 'stty' will affect the outcome of the above call (but
you'd have to ask someone who knows way more about it than I do). There
are at least a handful of differences in the various settings between
FreeBSD and Linux for the systems I'm using right now.
Messages sorted by: