Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: freebsd problems with carriage return
- X-seq: zsh-users 13971
- From: Atom Smasher <atom@xxxxxxxxxxx>
- To: Stephane Chazelas <stephane_chazelas@xxxxxxxx>
- Subject: Re: freebsd problems with carriage return
- Date: Thu, 26 Mar 2009 21:09:58 +1300 (NZDT)
- Cc: Zsh Users <zsh-users@xxxxxxxxxx>
- In-reply-to: <chaz20090325122302.GB5054@xxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Openpgp: id=0xB88D52E4D9F57808; algo=1 (RSA); size=4096; url=http://atom.smasher.org/pgp.txt
- References: <20090324101411.66890.qmail@xxxxxxxxxxx> <chaz20090324114727.GA5144@xxxxxxxxxxx> <20090324213624.93603.qmail@xxxxxxxxxxx> <alpine.LNX.2.00.0903250227080.3609@averatec> <chaz20090325122302.GB5054@xxxxxxxxxxx>
On Wed, 25 Mar 2009, Stephane Chazelas wrote:
Except that as far as I can see from the source code, it does an
explicit fflush() after each progress line, so it shouldn't be a stdio
buffering issue. Unless the OP's using an old version of rsync on
FreeBSD?
==================
freebsd:
rsync version 3.0.2
rsync version 3.0.5
linux:
rsync version 2.6.9
The fact that you don't get the output when stdout is a pipe is probably
the place to look at. But I don't know why rsync would decide not to
output the progress when stdout is pipe as opposed to when it's a
regular file.
====================
hhmmm... it may be related to a pipe (but it works as expected on linux,
with a pipe or redirect)... so maybe i can use a redirect as if it's a
pipe...
http://smasher.org/tmp/snapshot154.png
the top half of that split screen is `tr` converting carriage returns into
newlines, and reading stdin from a fifo. the bottom half is rsync, with
stdout redirected into the fifo. it's working as desired and expected,
even on freebsd.
what seems to me like just a slight variation of that, once again works on
linux and fails on freebsd:
tr '\r' '\n' < <( rsync --progress --bwlimit=5 foo_in foo_out )
or:
rsync --progress --bwlimit=5 foo_in foo_out > >( tr '\r' '\n' )
my understanding of zsh; process substitution should operate as a fifo. so
i really don't get why it works as desired in the screen-shot, but not
with process substitution.
--
...atom
________________________
http://atom.smasher.org/
762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808
-------------------------------------------------
"Only when the last tree has died,
And the last river poisoned,
And the last fish been caught,
Will the white man realize that he cannot eat money"
--19th Century Cree Indian Proverb
Messages sorted by:
Reverse Date,
Date,
Thread,
Author