Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: freebsd problems with carriage return
- X-seq: zsh-users 13966
- From: Stephane Chazelas <stephane_chazelas@xxxxxxxx>
- To: Atom Smasher <atom@xxxxxxxxxxx>
- Subject: Re: freebsd problems with carriage return
- Date: Wed, 25 Mar 2009 11:02:34 +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=rFXgh67kv2neUxNXflzQd8RKcoT1YGSl15VhcNwzx5fh/Z8g1WBQBDC2WhUOlOBIIvDgFAHlkVUunmOqBdtrdQtqZfArXYkqAGQCOKPWETm1YNlXAw9h7WQ1YsbUaroz17NUCz7mtqb/izGhoKAiWTyynpC8CrC174HVEUmY07U= ;
- In-reply-to: <20090324213624.93603.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> <chaz20090324114727.GA5144@xxxxxxxxxxx> <20090324213624.93603.qmail@xxxxxxxxxxx>
2009-03-25 10:36:21 +1300, Atom Smasher:
> On Tue, 24 Mar 2009, Stephane Chazelas wrote:
>
>> 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.
> =================
>
> huh?
>
> here are screen-shots of what it's doing on linux, which is what i expect
> and desire:
> http://smasher.org/tmp/snapshot149.png
> http://smasher.org/tmp/snapshot150.png
>
> here's a screen-shot of modifying IFS, which i almost thought would work,
Sorry for the confusion, this was a remark on your code. I was
not suggesting that it was a fix for your problem.
read without -r processes the backslashes in its input
specially, so you generally need to pass it especially in
scripts.
Same, if you don't remove the white space characters from IFS,
read strips the leading and trailing ones.
$ print ' \\a \rb' | read -d $'\r' a; print -r "$a" | cat -vte
a$
$ print ' \\a \rb' | IFS= read -rd $'\r' a; print -r "$a" | cat -vte
\a $
[...]
>> 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
> foo_in$
> 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
> <<snip>
>
> <<<<<<<<
>
> all of rsync's output of interest is stdout. it's mostly a bunch of
> progress updates, separated by carriage returns.
>
[...]
But here, stdout is a regular file, not a pipe. Do you get the
same if you do rsync --progress -h --bwlimit=5 ./foo_in ./foo_out | cat -vet
Also, you could use ktrace/truss/strace or the equivalent on
your system to see if rsync is actually outputing those progress
lines.
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author