Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: freebsd problems with carriage return
- X-seq: zsh-users 13964
- From: Atom Smasher <atom@xxxxxxxxxxx>
- To: Stephane Chazelas <stephane_chazelas@xxxxxxxx>
- Subject: Re: freebsd problems with carriage return
- Date: Wed, 25 Mar 2009 10:36:21 +1300 (NZDT)
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <chaz20090324114727.GA5144@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>
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,
but it makes sense that it doesn't work as above:
http://smasher.org/tmp/snapshot151.png
the 151 screen shot shows what doesn't work. if i try the commands used in
the 149 or 150 screen-shots on freebsd, i get the same non-results as
shown in 151; the name of the file i'm rsyncing, and then nothing.
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.
--
...atom
________________________
http://atom.smasher.org/
762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808
-------------------------------------------------
"I am a great mayor;
I am an upstanding Christian man;
I am an intelligent man;
I am a deeply educated man;
I am a humble man."
-- Marion Barry
Mayor, Washington, D.C
Messages sorted by:
Reverse Date,
Date,
Thread,
Author