Skip to content

cp: skip duplicate source check when --backup is given #6827

@matrixhead

Description

@matrixhead

When duplicate sources and the --backup option are provided to cp, GNU cp skips the duplicate source check and proceeds with copying the files. However, uu-cp does not currently behave this way.

For example

touch a; mkdir d;
cp --backup a a d/ 

GNU's cp would skip duplicate source check and tries to overwrite the "just-created" file and give us the error, (if backup--numbered is given then this won't file).

cp: will not overwrite just-created 'd/a' with 'a'

While uu-cp would give us

cp: warning: source file 'a' specified more than once

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions