bug-coreutils
[Top][All Lists]
Advanced

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

Re: cp (coreutils) 5.2.1 -v option says nothing with -i --reply


From: Bob Proulx
Subject: Re: cp (coreutils) 5.2.1 -v option says nothing with -i --reply
Date: Wed, 3 Aug 2005 20:42:44 -0600
User-agent: Mutt/1.5.9i

Jerry Peek wrote:
> Hi.  Maybe there's somewhere to check to see whether this bug has
> already been answered.  I'm sorry that I'm not checking, but I
> have just a minute before I have to leave -- and after that I'll
> probably forget!  So I'm mentioning this.

Of course everyone would like patches with the solution.  But in any
case your interest in reporting problems is appreciated.  :-)

>    cp (coreutils) 5.2.1
>     $ cp -i --reply=no -v /home/jpeek/.bashrc ideas
> 
> The destination file "ideas" exists.  Because the -v switch
> (according to "man cp") will "explain what is being done", I
> expected that "cp" would tell me that it was about to copy
> the file.  But it doesn't.  It silently fails to copy.

This is because the file is not copied and so there is nothing to
report, verbose or not.  ("Drawing upon my fine command of the English
language, I said nothing."  Robert Benchley)

The -i means to prompt before overwriting an existing file.  So the
file must exist before a prompt is produced.  The --reply=no means
that if and only if there is a prompt then the answer will be no.  (By
the way, this option is now deprecated.  It did not do what people
really wanted and was very misleading.  The functionality that people
want has not yet been written.)  The cp would prompt, the answer is
not, so no copy is performed.  No files were copied and so nothing was
printed.

> This is a real pain in situations like the following:
> 
>     $ cp -i --reply=no -v `locate somefile` backup-dir
> 
> where I would *really* like to know which file wasn't copied.
> But here, "cp -v" only tells me which files *were* copied.
> The only way I can tell that a copy failed is to compare the

The functionality you are asking for does not exist in the command.
I think that if you have special needs such as you do in this case
that it would be best to script exactly what you want.  The scripting
of this seems fairly straight-forward and could work with any cp
command.

> output of "locate somefile" with the copied files... somehow.
> Or I can use a loop, or xargs -t, to copy the files.  A pain.
> 
> Typing "info cp" tells me that the -v switch will "Print the
> name of each file before copying it."  That's a little more
> accurate -- and, I'd argue, still misleading -- because it
> only prints the names of files *after* copying (or so it
> seems).

But it is not copying the file, so it is not printing the name of the
file either before or after the copy.  (In the case that a copy is
performed it does actually print the message before the copy is
performed.)

> I wish that you would please either:
> 
> - make the man and info pages have a better explanation, or
> 
> - make 'cp -v' tell that a file *wasn't* copied, or

It does seem that if the user is asking for verbose output then the
user should get a verbose amount of output.  So this seems
reasonable.

> - add another verbose option that gives complete information
>   about, as the manpage says, " what is being done".
> 
> I hope that's complete enough.  I've gotta run.  Thanks...

The same for me...

Bob




reply via email to

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