I'm copying files from one machine to another.  Machine A has files in:/usr/a/foo/*/usr/b/foo/*/usr/c/foo/*/usr/d/foo/*Machine B wants these files in:/foo-1.2.3/usr/a/*/foo-1.2.3/usr/b/*/foo-1.2.3/usr/c/*/foo-1.2.3/usr/d/*I can flatten the structure using rsync -ae ssh user@remote:/var/*/foo/ /foo-1.2.3/var/, and I can separately copy each of the four directories, but I can't figure out if it's possible to do this in a single command without resorting to an outside helper (awk, sed, perl...).Note that this is sheer curiosity at this point, as it has taken longer to figure this out than it already took to do four separate copies.
Can rsync store wildcard names (perhaps using a variable)?
rsync