Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: freebsd problems with carriage return
- X-seq: zsh-users 13972
- From: Stephane Chazelas <stephane_chazelas@xxxxxxxx>
- To: Atom Smasher <atom@xxxxxxxxxxx>
- Subject: Re: freebsd problems with carriage return
- Date: Thu, 26 Mar 2009 09:45:20 +0000
- Cc: Zsh Users <zsh-users@xxxxxxxxxx>
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.fr; h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent; b=arL3VQt3gSqGdLTylDzaDuzh7Iu7kFdf/epVXJRN0WefKNkluR6kHT2Tm3C8PU/Q2xu2kxUOSeEn/F3YUUlt+QOyTXtTfdbDDYiljV7OlsboiyJc+wCrnMSIo1Q2xDzAXgHXr1Z93+NCv0auFipEmBK31kyROHuDIgTrQwWDA/E= ;
- In-reply-to: <20090326081003.68165.qmail@xxxxxxxxxxx>
- Mail-followup-to: Atom Smasher <atom@xxxxxxxxxxx>, Zsh Users <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20090324101411.66890.qmail@xxxxxxxxxxx> <chaz20090324114727.GA5144@xxxxxxxxxxx> <20090324213624.93603.qmail@xxxxxxxxxxx> <alpine.LNX.2.00.0903250227080.3609@averatec> <chaz20090325122302.GB5054@xxxxxxxxxxx> <20090326081003.68165.qmail@xxxxxxxxxxx>
2009-03-26 21:09:58 +1300, Atom Smasher:
[...]
> 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
[...]
Sorry, my previous email was a bit convoluted as I was writing
it while investigating. The last part of the email explained the
reason for the problem. On FreeBSD, tcgetpgrp() on a pipe
returns the id of the process group that is meant to receive a
SIGIO on that pipe (or 0 if nobody registered for SIGIO) while
rsync() expects it to return -1 (as it should according to POSIX
and its man page).
The effect of that is that as tcgetpgrp() return 0 instead of
-1, rsync things stdout is a terminal and as 0 is not the
progress group id of the process, it thinks it is running in
background so does *not* output its progress.
>
> 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.
[...]
Same thing, it's all pipes, so falls into that case.
Cheers,
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author