This fails to move /tmp/test_trash/a to /tmp/test because /tmp/test/aalready exists. Weirdly, it then goes on to successfully move/tmp/test_trash/a/bto /tmp/test/b. If we don't make the /tmp/test/a directory, this works as expected, creating /tmp/test/a/b.
Script to trigger this:
This fails to move
/tmp/test_trash/a
to/tmp/test
because /tmp/test/aalready exists. Weirdly, it then goes on to successfully move
/tmp/test_trash/a/bto /tmp/test/b
. If we don't make the/tmp/test/a
directory, this works as expected, creating/tmp/test/a/b
.