GNU bug report logs - #69532
mv's new -x option should be made orthogonal to -t/-T/default

Previous Next

Package: coreutils;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Mon, 4 Mar 2024 00:46:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Pádraig Brady <P <at> draigBrady.com>, 69532 <at> debbugs.gnu.org
Cc: Petr Malat <oss <at> malat.biz>
Subject: bug#69532: mv's new -x option should be made orthogonal to -t/-T/default
Date: Mon, 4 Mar 2024 20:35:00 -0800
On 3/4/24 12:35, Pádraig Brady wrote:
> Another point worth mentioning before changing this,
> is that changing would make the --swap operation non symmetric.
> I.e. `mv -x a d` would be different to `mv -x d a` where d in a directory.

Yes, of course. It's just like mv without the -x. After you've done an 
'mv a b', 'mv b a' will undo the rename, unless b is a directory.

I realize this business of the destination being a directory is a 
hassle. That's why I put in mv's -t and -T options years ago. But at 
this point it's such a well-known hassle that we really gotta stay 
consistent with it if we add options.

The "exch" shell command (in util-linux) is a different matter, as it 
has never had the target-directory hassle (i.e., it has always assumed -T).

In looking into this a bit more, I see a bunch of other gotchas. For 
example, 'mv -b' does not work with 'mv -x'. A bunch of other mv options 
also don't work with 'mv -x'. It's a real mess as-is and we can't ship 
it this way.






This bug report was last modified 1 year and 152 days ago.

Previous Next


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