On Sat, Jan 7, 2012 at 6:40 PM, John J Foerch <jjfoe...@earthlink.net>wrote:

> This is a feature request for a command-line option to disable
> special interpretation of trailing slashes on source directories.


One solution is to install a bash script (or setup a bash function) in
place of the real rsync that strips a single trailing slash from each arg.
 That lets you specify dir// if you want to copy a dir's contents.  Here's
one I did some mild tesing on and it appears to work OK:

#!/bin/bash
args=()
for arg in "${@}"; do
    # Strip a single trailing slash from each arg (if present)
    args=("${args[@]}" "${arg%/}")
done
echo /usr/bin/rsync "${args[@]}"
#exec /usr/bin/rsync "${args[@]}"

When you're satisfied with that, comment out the echo and uncomment the
exec.  Install it somewhere on your path ahead of the real rsync, or rename
the real rsync (tweak the script to exec the right binary) and install the
script in place of the current rsync binary.

..wayne..
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to