coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `cp: warning: behavior of -n is non-portable and may change in futur


From: Pádraig Brady
Subject: Re: `cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead`
Date: Tue, 10 Jun 2025 11:35:02 +0100
User-agent: Mozilla Thunderbird Beta

On 10/06/2025 08:56, Σταύρος Ντέντος wrote:
Hello there,

I was wondering: Should the error message contain `-n/--no-clobber`
and/or use the same flag as the one used in the invocation?

Rationale: I try to write my dotfiles without shorthands - for future
readability.
So, "after a distro upgrade (Ubuntu 24.04)", it was so weird to me to
read that "`-n` is deprecated".

I assumed it was because of the shorthand was used - but I haven't
used it. Because of the aliases, my `cp` is plain `cp [-r] a b`. So no
`-n` on the terminal,

Remembering that I am using an alias:
```
$ command -v cp
alias cp='cp --no-clobber --preserve=links --preserve=timestamps'
```
Which again felt weird - because I am not using `-n` at all.

I thought that *precisely* the shorthand was the one that was
"non-portable" (for some out-of-my-understanding shorthand-flag
reason).

Version: `GNU coreutils 9.4, April 2024`

With regards,
Ntentos Stavros


Can you confirm `cp --version` says 9.4
We only deprecated --no-clobber in 9.5.
Also we don't error, only document
(and always mention both long and short options in the deprecation docs).

thanks,
Padraig



reply via email to

[Prev in Thread] Current Thread [Next in Thread]