GNU bug report logs - #20603
Possible bug in cp

Previous Next

Package: coreutils;

Reported by: Chris Puttick <cputtick <at> gmail.com>

Date: Mon, 18 May 2015 15:45:06 UTC

Severity: normal

Tags: notabug

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 20603 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Chris Puttick <cputtick <at> gmail.com>, 20603 <at> debbugs.gnu.org
Subject: Re: bug#20603: Possible bug in cp
Date: Mon, 18 May 2015 16:55:40 +0100
tag 20603 notabug
close 20603
stop

On 18/05/15 14:04, Chris Puttick wrote:
> Hi
> 
> In moment of tiredness issued a cp command similar to
> 
> cp /path/to/files/*
> 
> neglecting to add a destination (should have been ./)
> 
> The files in the directory were 2 vdisks both ending .qcow2.
> 
> No error message was generated and the apparent result of running the
> command is that the file whose name came first alphabetically was
> copied over the other.
> 
> The installed OS on the machine was Ubuntu 12.04 and cp version 7.4.
> 
> I can provide more details on request.

You were unlucky that the glob expanded to two files.
With more files you would have gotten an error.
However the expansion is done before cp executes,
and so there is no opportunity to behave differently here.

thanks,
Pádraig





This bug report was last modified 6 years and 219 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.