- This topic is empty.
-
AuthorPosts
-
May 20, 2024 at 5:29 am #24958
Catherine
Guestseeing this on new installs
cp: warning: behavior of -n is non-portable and may change in future; use --update=none insteadMay 20, 2024 at 5:32 am #24960Juan
GuestI think
-nis for GNU, sincecpwas ported from POSIX. But pretty sure Ubuntu and Debian have supported that flag for many years already?May 20, 2024 at 5:34 am #24961Judith
GuestAccording to mailing lists,
https://www.mail-archive.com/[email protected]/msg33577.html
The new
--update=nonedoesn’t even work correctly and is overwriting files so I don’t think it’s a good idea to use that flag either!May 20, 2024 at 5:39 am #24962Gregory
Guestweird, as
cphas been around forever…May 20, 2024 at 5:42 am #24963Juan
GuestSome of the Debian maintainers discussed this on Reddit a few months ago. They are saying it seems to be a bug and should be fixed in future versions. I don’t know how such a verbose warning message could be a bug, but if I understand correctly that’s what they are saying:
May 20, 2024 at 5:57 am #24964Jacqueline
GuestSome of the Debian maintainers discussed this on Reddit a few months ago. They are saying it seems to be a bug and should be fixed in future versions.
On second reading, I’m not sure they are saying it’s a bug.
But maybe just that
aptusingcp -nis a bug. It’s not really clear.May 28, 2024 at 6:15 am #25079Frank
Guestwhat are they asking for?
cp --update=noneinstead ofcp -nis that?October 1, 2024 at 7:32 am #26694Wayne
GuestDO NOT DO WHAT THIS WARNING TELLS YOU TO DO!!!
YOU MIGHT BREAK YOUR STACK OR LOSE DATA THIS WARNING IS A BUG
February 22, 2025 at 8:08 am #27511Cynthia
GuestThe warning is NOT a bug. The
-nor--no-clobberreally is deprecated with planned removal fromcpin the future. However, their suggested fix with--update=nonehas been reported as having bugs.For this reason, and the fact that
--update=noneis NOT backwards compatible (it is not recognized on Ubuntu 22.04, 20.04, 18.04 etc) SlickStack has taken another route:## ss_cp_if_not_exists (avoids deprecated -n option) ## function ss_cp_if_not_exists { command mkdir -p "$(dirname "$2")" && command test ! -e "$2" && command cp "$1" "$2" }This approach simply avoids the problems altogether 😉
Ref: https://github.com/littlebizzy/slickstack/blob/master/bash/ss-functions.txt
Because if you try to use
--update=noneon those older Ubuntu versions, well it will fail and you will see this error:cp: option ‘–update’ doesn’t allow an argument
Try ‘cp –help’ for more information.February 22, 2025 at 8:10 am #27512Russell
Guestpeople are pissed lmao
Is anybody else annoyed by the disruptive changes to cp's –no-clobber option in gnu coreutils 9.x?
byu/snyone inlinuxFebruary 22, 2025 at 8:22 am #27513 -
AuthorPosts