Interesting discussion on ETXTBSY
Interesting discussion on ETXTBSY
Posted Aug 23, 2021 1:26 UTC (Mon) by Wol (subscriber, #4433)In reply to: Interesting discussion on ETXTBSY by neilbrown
Parent article: The shrinking role of ETXTBSY
If the target is a pre-existing directory, it copies into it. If the target is a pre-existing file it overwrites it. And if the target doesn't exist, it makes a copy called the target.
In other words, if you are copying directories in a script, you need a whole bunch of wrapper code if you want the results to be reproducible.
Cheers,
Wol
Posted Aug 23, 2021 5:01 UTC (Mon)
by mchapman (subscriber, #66589)
[Link]
In other words, if you are copying directories in a script, you need a whole bunch of wrapper code if you want the results to be reproducible.
You can use
With GNU
Interesting discussion on ETXTBSY
cp -R source/. dest/, which will do the right thing whether or not dest is an existing directory.
cp, you can also do cp -R --no-target-directory source/ dest/.
