With -T the target is meant to be the destination itself, but when it is a symlink to a directory, cp -rT copies the tree into the directory the link points at and exits 0. GNU refuses with "cannot overwrite non-directory 'dst' with directory 'src'".
mkdir -p src real; echo new > src/f; echo old > real/f; ln -s real dst
cp -rT src dst # uutils: rc=0, real/f is now "new"; GNU: error, real/f untouched
A related case: cp -r src dst with dst a dangling symlink creates the directory it points at (on Linux it fails with "File exists" instead). GNU refuses that too.
Checked with uutils main at 2b85f6f and GNU 9.12 built from source.
With
-Tthe target is meant to be the destination itself, but when it is a symlink to a directory,cp -rTcopies the tree into the directory the link points at and exits 0. GNU refuses with "cannot overwrite non-directory 'dst' with directory 'src'".A related case:
cp -r src dstwithdsta dangling symlink creates the directory it points at (on Linux it fails with "File exists" instead). GNU refuses that too.Checked with uutils main at 2b85f6f and GNU 9.12 built from source.