A NOTE has been added to this issue. ====================================================================== https://austingroupbugs.net/view.php?id=1824 ====================================================================== Reported By: dag-erling Assigned To: ====================================================================== Project: Issue 8 drafts Issue ID: 1824 Category: Shell and Utilities Type: Clarification Requested Severity: Editorial Priority: normal Status: New Name: Dag-Erling Smørgrav Organization: User Reference: Section: Utilities Page Number: 2741-2748 Line Number: 90593-90715, 90876-90880 Final Accepted Text: ====================================================================== Date Submitted: 2024-04-01 15:31 UTC Last Modified: 2024-05-20 09:26 UTC ====================================================================== Summary: cp: directories and symlinks ======================================================================
---------------------------------------------------------------------- (0006788) geoffclare (manager) - 2024-05-20 09:26 https://austingroupbugs.net/view.php?id=1824#c6788 ---------------------------------------------------------------------- Before we can work on wording, we need to decide what behaviour(s) to require/allow for -P. We should be guided by existing practice. I tried a few tests on the systems I have access to. - First I tried this:<pre>mkdir targdir; ln -s targdir destdir echo src > src cp -RP src destdir</pre>and cp created src in targdir (on Solaris, Linux, and macOS). - Then I tried this:<pre>mkdir destdir; cd destdir; echo targ > targ; ln -s targ src cd ..; echo src > src cp -RP src destdir</pre>and cp copied src contents into the targ file (on Solaris, Linux, and macOS). - Then I tried this:<pre>mkdir subdir destdir; cd destdir; mkdir targdir; ln -s targdir subdir cd ../subdir; echo src > src; cd .. cp -RP subdir destdir</pre>Solaris and macOS created src in targdir. Linux failed with "cannot overwrite non-directory 'destdir/subdir' with directory 'subdir'" Conclusion: Solaris and macOS consistently follow destination symlinks, as does historical FreeBSD according to the bug description, but Linux (GNU coreutils 9.1 on a Debian system) is inconsistent; it follows destination symlinks in two out of three of my test cases but does not in the other case. Issue History Date Modified Username Field Change ====================================================================== 2024-04-01 15:31 dag-erling New Issue 2024-04-01 15:31 dag-erling Name => Dag-Erling Smørgrav 2024-04-01 15:31 dag-erling Section => Utilities 2024-04-01 15:31 dag-erling Page Number => 2741-2748 2024-04-01 15:31 dag-erling Line Number => 90593-90715, 90876-90880 2024-04-02 06:19 dannyniu Note Added: 0006731 2024-04-02 06:20 dannyniu Note Added: 0006732 2024-04-02 06:21 dannyniu Note Deleted: 0006732 2024-04-02 06:22 dannyniu Note Edited: 0006731 2024-04-02 15:51 geoffclare Note Added: 0006734 2024-04-04 14:30 geoffclare Note Added: 0006737 2024-04-04 16:01 dag-erling Note Added: 0006739 2024-04-04 16:59 geoffclare Note Added: 0006740 2024-04-04 18:19 geoffclare Note Edited: 0006740 2024-04-05 08:16 geoffclare Note Edited: 0006740 2024-04-05 11:33 dag-erling Note Added: 0006741 2024-04-08 08:39 geoffclare Note Added: 0006743 2024-04-08 08:42 geoffclare Note Edited: 0006737 2024-04-08 08:44 geoffclare Note Edited: 0006743 2024-05-20 09:26 geoffclare Note Added: 0006788 ======================================================================
