bug-coreutils
[Top][All Lists]
Advanced

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

renameutils 0.6.0


From: Brian Hall
Subject: renameutils 0.6.0
Date: Tue, 9 Aug 2005 13:38:25 -0600
User-agent: Mutt/1.5.8i

(cc: to bug-coreutils in case this is a coreutils problem)

We have talked about this before, but I have never been able to get imv 
to work without patching it to change the order of the arguments passed 
to "mv". icp has the same issue. qmv works fine.

Based on your last email to me about this (September, sorry!), I tried 
this at the command line:

-----------------------------------------------------------------

> unalias mv

-----------------------------------------------------------------

The order of the arguments passed my imv doesn't work:

> strace imv setup-gentoo-chroot
execve("/usr/bin/mv", ["mv", "setup-gentoo-chroot", "--", 
"setup-gentoo-chroot.sh"], [/* 68 vars */]) = 0
uname({sys="Linux", node="syrinx", ...}) = 0

mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.

-----------------------------------------------------------------

Adding a mv-only option doesn't help:

> imv -v setup-gentoo-chroot
> setup-gentoo-chroot.sh
mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.

> imv --verbose setup-gentoo-chroot
> setup-gentoo-chroot.sh
mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.

-----------------------------------------------------------------

Testing at the command line, without imv:

> mv setup-gentoo-chroot -- setup-gentoo-chroot.sh
mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.

Adding a leading "\" to the mv command, or specifying the path doesn't 
help:

> \mv setup-gentoo-chroot -- setup-gentoo-chroot.sh
mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.

> /usr/bin/mv setup-gentoo-chroot -- setup-gentoo-chroot.sh
/usr/bin/mv: when moving multiple files, last argument must be a 
directory
Try `/usr/bin/mv --help' for more information.

> mv -v setup-gentoo-chroot.sh -- setup-gentoo-chroot
mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.

-----------------------------------------------------------------

This order works:

> mv -- setup-gentoo-chroot.sh setup-gentoo-chroot

as does this (which I think was your intent):

> mv -v -- setup-gentoo-chroot setup-gentoo-chroot.sh
`setup-gentoo-chroot' -> `setup-gentoo-chroot.sh'

-----------------------------------------------------------------

The man page for mv simply says that "--" should "terminate the option 
list". Hmmm. I guess it expects "--" to occur as the last NON-FILE 
argument? If so, puttting it in between the file arguments is the source 
of the problem. Do you have a reference that says something like

mv name1 -- name2

is legal syntax? If not, I see no particular benefit to passing the 
arguments in this order. Granted, perhaps it should be accepted by mv 
and cp, but what advantage is there in ordering the arguments like this?
I would humbly suggest swapping the order of the arguments passed to 
mv and cp via execve to be:

#1 all arguments passed to imv/icp on the command line (not --help,etc)
#2 --
#3 file argument #1
#4 file argument #2

Maybe the version of coreutils (mv,cp) you're using is different 
than mine? I am runing Gentoo 2005.1 on ~amd64.

> epm -q coreutils
coreutils-5.2.1-r6
> epm -q renameutils
renameutils-0.6.0


--
Brian Hall
Linux Consultant
http://pcisys.net/~brihall




reply via email to

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