What is the simplest way to remove a trailing slash from each parameter in the \'$@\' array, so that rsync copies the directories by name?
rsync
rsync -a
This works for me: ${VAR%%+(/)}
${VAR%%+(/)}
As described here http://wiki.bash-hackers.org/syntax/pattern
May need to set the shell option extglob. I can't see it enabled for me but it still works