GNU bug report logs - #6960
mv refuses to move a symlink over a hard link to the same file

Previous Next

Package: coreutils;

Reported by: Matt McCutchen <matt <at> mattmccutchen.net>

Date: Tue, 31 Aug 2010 21:27:01 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


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

From: Jim Meyering <jim <at> meyering.net>
To: "Voelker\, Bernhard" <bernhard.voelker <at> siemens-enterprise.com>
Cc: Matt McCutchen <matt <at> mattmccutchen.net>, 6960 <at> debbugs.gnu.org
Subject: Re: bug#6960: mv refuses to move a symlink over a hard link to the
	same	file
Date: Thu, 02 Sep 2010 12:28:18 +0200
Voelker, Bernhard wrote:
> Jim Meyering wrote:
>
>> It is a deliberate feature.
>>
>> Personally, I prefer the semantics of 'mv -f --backup=numbered'
>> so use a shell alias.
>
> just for fun I tried to get no backup created and tried '--backup=never',
> but a backup is still created (version 8.5 on Cygwin, and 5.93 on SLES-10.3):
>
> $ uname -a > a
> $ ln -s a b
> $ mv -v --backup=never b a
> `b' -> `a' (backup: `a~')
> $ ls -l a a~
> lrwxrwxrwx  1 vb027591 ugrp  1 2010-09-02 11:50 a -> a
> -rw-r--r--+ 1 vb027591 ugrp 69 2010-09-02 11:50 a~
>
> I expected mv either to fail as if --backup=... is not given,
> or that it moves the file without creating a backup.
>
> Maybe I'm a bit confused that the combination of the words "backup"
> and "never" contrasts to what it does: it _creates_ a backup
> - though mentioned in manual:
>
> $ man mv
> ...
>        simple, never
>               always make simple backups
>
> Am I just misunderstanding the backup CONTROL "never"?

--backup=never means "never make numbered backups; always make single
backups", quoting emacs documentation (see 'Single or Numbered Backups' in
info emacs).  That's where that ambiguous name originated.

Or perhaps more relevant, see "info coreutils mv":

    `simple'
    `never'
          Always make simple backups.  Please note `never' is not to be
          confused with `none'.

When in doubt, refer to the "info" documentation,
not the man page.




This bug report was last modified 13 years and 179 days ago.

Previous Next


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