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 -a --exclude='*~' "$@" "$dir"
The title has been changed for clarification. To understand the comments and answer about multiple trailing slashes see the edit history.