bug-coreutils
[Top][All Lists]
Advanced

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

bug#8381: cp inconsistency


From: Pádraig Brady
Subject: bug#8381: cp inconsistency
Date: Wed, 30 Mar 2011 15:10:43 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

On 30/03/11 12:56, Thomas Hofmann wrote:
> Hello,
> 
> two issues:
> 1) manpage of cp contains obsolete email-address for bug-reporting

That is fixed in current versions

> 2) cp inconsistency when copying a directory to a) a non existing
> directory, or b) to an existing directory. Further elaborated below.
> 
> cp -a SOME_DIR NOT_YET_EXISTING_DIR
> 
> results in a new directory directly containing each entry of SOME_DIR
> 
> while:
> CP -a SOME_DIR EXISTING_DIR
> 
> results in EXISTING_DIR/SOME_DIR
> 
> The first result seems to be a reasonable outcome in both cases.
> Appending "/" to the directory-names should lead to the same result.
> While appending "/." to the target-directory would change the meaning,
> and rather lead to the result of the observed second version.

So you would like

cp -a dir dest_dir  # copy dir/* to dest_dir/
cp -a dir dest_dir/ # copy dir to dest_dir/

That seems a bit subtle to me.
Currently one can get the first behavior using `cp -aT`
so I'll close this.

Note also the related:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7450

cheers,
Pádraig.





reply via email to

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