Skip to main content
12 events
when toggle format what by license comment
Feb 3, 2020 at 20:38 comment added Basj Thanks for your answer about ${1:-abc}. It probably failed is because I tried it on Windows (I'm using rsync both on Linux for my distant server, and Windows locally). But it's perfect since rsync --read-batch=abc-diff abc works :)
Feb 3, 2020 at 20:36 comment added Kusalananda @Basj I'm not entirely sure that this is possible, but I'll have a look tomorrow after sleep.
Feb 3, 2020 at 20:34 comment added Kusalananda @Basj The commands would do different things if $1 had a value. ${1:-abc} means "use the first positional parameter ($1) unless it's empty or undefined. In the case that it's empty or undefined, use abc instead". I'm assuming that $1 had a value when you tried it, possibly something that it interpreted as a remote destination address.
Feb 3, 2020 at 19:52 vote accept Basj
Feb 3, 2020 at 19:30 comment added Basj 2/2 Is there a way to take abc as input, apply the patch diff-abc with --read-batch but not modify abc "in-place", but rather output to a new file abc3? (if possible all with rsync, without piping, so that it will work easily on Linux as well as Windows which also has rsync.exe available)
Feb 3, 2020 at 19:21 comment added Basj Thanks a lot @Kusalananda, it's great! PS: rsync --read-batch=abc-diff ${1:-abc} (automatically generated .sh script) gave remote destination is not allowed with --read-batch rsync error: syntax or usage error (code 1) at main.c(1326) [Receiver=3.1.2], but rsync --read-batch=abc-diff abc worked succesfully. What is the difference between these two similar commands?
Feb 3, 2020 at 17:05 history edited Kusalananda CC BY-SA 4.0
edited body
Feb 3, 2020 at 16:44 history edited Kusalananda CC BY-SA 4.0
added 35 characters in body
Feb 3, 2020 at 16:37 history edited Kusalananda CC BY-SA 4.0
added 119 characters in body
Feb 3, 2020 at 16:30 history edited Kusalananda CC BY-SA 4.0
added 264 characters in body
Feb 3, 2020 at 16:14 history edited Kusalananda CC BY-SA 4.0
added 225 characters in body
Feb 3, 2020 at 16:09 history answered Kusalananda CC BY-SA 4.0