1

I'm using bash version 3.0.9 under Centos 7, and I just can't seem to find a combination of escaping that will let me pass single quotes to the out-format parameter. I've tried every combination I think of to wrap the options in single or double quotes, escaping the single ones with backslashes, concatenating strings, passing them in as variables, nothing seems to work. Apparently the command below should work to give me human-readable file sizes, but I just get the single quotes you see in the output:

$ rsync -crthivn --out-format="%n %''l" /from_folder /to_folder
sending incremental file list
test/ %''l
test/file1 %''l
test/folders_current %''l
test/test2/ %''l
test/test2/file2 %''l

sent 191 bytes  received 29 bytes  440.00 bytes/sec

I thought that bash escaping would be the root of the problem, but I'm getting the same results when I try with sh and csh. So I'm very confused now! Any help appreciated.

1 Answers1

1

Just to follow up on this, it looks like a bug in 3.0.9 - I've found that the problem goes away after upgrading to rsync 3.1.2 (which you have to do manually because you can only get up to 3.0.9 from the official Centos repositories).

I followed the instructions from here for how to do it:

https://stackoverflow.com/questions/36407399/why-the-latest-vesion-of-rsync-could-not-be-installed-on-centos-7-2