Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: freebsd problems with carriage return
- X-seq: zsh-users 13963
- From: Stephane Chazelas <stephane_chazelas@xxxxxxxx>
- To: Atom Smasher <atom@xxxxxxxxxxx>
- Subject: Re: freebsd problems with carriage return
- Date: Tue, 24 Mar 2009 11:47:27 +0000
- Cc: 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=xSCZZms1IyknBiYaA+s4BFrO69f+owZhOWhwlLuWUTj2Gt3BJ4vT6Z/6TZO7k47SBp6U4/Ov47s1XiS4lINrqDYtoxE/VN2ZTSuO2LMe24ln7LZtZ9ktUc/tlWLDru9Y+ThvQYrz0SLBt5vV86q+OY4aVLX1IeQIVLYEQuwMTaw= ;
- In-reply-to: <20090324101411.66890.qmail@xxxxxxxxxxx>
- Mail-followup-to: Atom Smasher <atom@xxxxxxxxxxx>, zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20090324101411.66890.qmail@xxxxxxxxxxx>
2009-03-24 23:14:09 +1300, Atom Smasher:
> on linux this works as expected:
>
> rsync --progress /from /to | while read -d "`print '\r'`" n
See $'\r' instead of "`print '\r'`"
> do
> print " foo: $n"
should be print -r, print without -r expands the \ sequences.
You should probably use IFS= read -r instead of read as well.
> done
>
> as rsync uses a carriage return to update the progress of the file
> transfer, the "read" builtin uses '\r' as a delimiter, and prints the
> output as expected, one line at a time.
>
> on freebsd it doesn't work at all.
In which way does it not work?
> i suspect the bug may be in bsd's
> libraries, because a similar thing happens on linux and fails to happen on
> freebsd with:
> rsync --progress /from /to | tr '\r' '\n'
>
> of course linux is using gnu-tr and freebsd is using bsd-tr.
>
> can anyone help identify the source of the problem, and/or a workaround?
[...]
run
rsync --progress /from /to | sed -n l
(or od -c)
to see what rsync actually outputs.
Also, in case rsync outputs it on stderr, try:
rsync --progress /from /to 2>&1 | sed -n l
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author