[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#6960: mv refuses to move a symlink over a hard link to the same file
From: |
Jim Meyering |
Subject: |
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.