What is the easiest way to remove the trailing slash from each parameter in the $ @ array so that rsync copies directories by name?
rsync -a --exclude='*~' "$@" "$dir"
The name has been changed to clarify. To understand the comments and response to a few trailing slashes, review the change history.
bash shell arguments rsync stripslashes
sid_com Jan 26 '12 at 13:24 2012-01-26 13:24
source share