Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xonsh and rsync command

I have a test folder like this:

[20/01/3|2:08:12][samuel@localhost:/tmp]
>>> ls test1
1.txt  2.txt  3.txt  4.txt  5.txt

in a normal bash/zsh shell this is the output of the command

>>> rsync -avz --exclude="2.txt" --dry-run test1/ test2/
sending incremental file list
./
1.txt
3.txt
4.txt
5.txt

sent 138 bytes  received 31 bytes  338.00 bytes/sec
total size is 0  speedup is 0.00 (DRY RUN)
[20/01/3|2:10:42][samuel@localhost:/tmp]

but in a xonsh shell, this is the output

samuel@localhost /tmp $ rsync -avz --exclude="2.txt" --dry-run test1/ test2/                                                            
sending incremental file list
./
1.txt
2.txt
3.txt
4.txt
5.txt

sent 156 bytes  received 34 bytes  380.00 bytes/sec
total size is 0  speedup is 0.00 (DRY RUN)
samuel@localhost /tmp $

I try changing also with single apex, but result is the same.

Can anyone explain me where this simple command wrongs ??

My xonsh version is 0.9.11, but I test also with 0.9.13

like image 687
Samuel Panicucci Avatar asked May 20 '26 04:05

Samuel Panicucci


1 Answers

When you run under xonsh, there is no processing similar to shell quoting. The parameters are passed AS-IS to the rsync program. In particular, '--exclude="2.txt"' will be passed to rsync with the quotes.

To exclude the 2.txt, and not "2.txt", the command to 'xonsh' should be:

rsync -avz --exclude=2.txt --dry-run test1/ test2/
like image 103
dash-o Avatar answered May 22 '26 17:05

dash-o