Skip to content

cp: doesn't copy directory when first path ends in dot #7871

@SArpnt

Description

@SArpnt

unlike what's shown in #3897, if only the first argument ends in a dot the directory should still be copied

gnu cp 9.5:

mkdir x
cp -r x/. y # directory y is created
mkdir x
touch x/foo
cp -r x/. y # directory y is created with file foo

uutils 0.0.30:

mkdir x
cp -r x/. y # directory y isn't created
mkdir x
touch x/foo
cp -r x/. y # command fails with following error

cp: '($PWD)/x/./foo' -> 'y/foo': No such file or directory (os error 2)

mkmm relies on this behaviour

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