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
realpath resolves given path. Among other things it also removes trailing slashes. Use -s to prevent following simlinks
realpath
-s
DIR=/tmp/a/// echo $(realpath -s $DIR) # output: /tmp/a