[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: renameutils 0.6.0
From: |
Bob Proulx |
Subject: |
Re: renameutils 0.6.0 |
Date: |
Thu, 11 Aug 2005 17:18:56 -0600 |
User-agent: |
Mutt/1.5.9i |
Oskar Liljeblad wrote:
> Brian Hall wrote:
> > 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.
>
> How can the above execve-call lead to the error message above?
The execve call above is:
/usr/bin/mv setup-gentoo-chroot -- setup-gentoo-chroot.sh
The mv command has two forms:
info coreutils mv
mv [OPTION]... SOURCE DEST
mv [OPTION]... SOURCE... DIRECTORY
It is an error if the last argument is not a directory and more than
two files are given.
The first one is for when there are two non-option arguments and the
second one is for when there are three or more non-option arguments.
Because the example has three non-option arguments the last argument
must be a directory. It is not and so the error is generated.
> I cannot explain that, other than that mv thinks "--" is a file
> of itself.
GNU mv allows options to appear anywhere on the line. But that is not
standard nor portable. It is a system dependent behavior. Standard
commands require options to occur before non-arguments on the command
line.
See guideline 9 from the standards documentation:
http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02
> My mv from coreutils 5.2.1 doesn't do that, not even
> if there's a local file "--".
GNU mv will conform strictly to standard behavior if POSIXLY_CORRECT
is set.
touch a
mv a -- b
touch a
POSIXLY_CORRECT=1 mv a -- b
mv: when moving multiple files, last argument must be a directory
Try `mv --help' for more information.
Bob