<div class="gmail_quote">On Sat, Jan 7, 2012 at 6:40 PM, John J Foerch <span dir="ltr"><<a href="mailto:jjfoerch@earthlink.net">jjfoerch@earthlink.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This is a feature request for a command-line option to disable special interpretation of trailing slashes on source directories.</blockquote><div><br></div><div>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:</div>
<div><br></div><div><div>#!/bin/bash</div><div>args=()</div><div>for arg in "${@}"; do</div><div>    # Strip a single trailing slash from each arg (if present)</div><div>    args=("${args[@]}" "${arg%/}")</div>
<div>done</div><div>echo /usr/bin/rsync "${args[@]}"</div><div>#exec /usr/bin/rsync "${args[@]}"</div></div></div><div><br></div>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.<br>
<br><div>..wayne..<br>
</div>