Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

mv --reply=
I've never had the occasion to use "--reply=[yes|no|query]" with `mv`
before this.  It looked like a good solution for me in a recent task, so
it tried it.

Snafu!

I had a large directory of mp3's and a smaller directory of mp3's --- _some_
of which were duplicates (by filename) of files in the larger directory.
I wanted to move the non-dupes (only) into the larger directory.

From inside the smaller directory:

$ mv --reply=no *.mp3 ../LargeDirectory/

I was left with no files in the smaller directory and, indeed, _all_ of
the files were moved -- with the duplicates overwriting the files in the
larger directory.

I did some testing.
That's the way it's working here. `mv --reply=no` seems to act as if I
was replying "yes".

I have `alias mv="mv -i"` set in my .bashrc, so I also did tests with

$ /bin/mv --reply=no .........

Same results.

`man mv` states:

--reply={yes,no,query}
specify how to handle the prompt about an  existing
destination file

At www.gnu.org/software/coreutils/manu...nvocation.html, I
find this on the "--reply" option:

*Deprecated: to be removed in 2008.*

OK .......... but this happened on Mandrake 10.2, aka MDK LE2005.

What am I doing wrong?

Jonesy
--
Marvin L Jones    | jonz          | W3DHJ  | linux
38.24N  104.55W  |  @ config.com | Jonesy |  OS/2
*** Killfiling google posts: <http://jonz.net/ng.htm>

Report this thread to moderator Post Follow-up to this message
Old Post
Allodoxaphobia
04-03-08 03:54 AM


Re: mv --reply=
Allodoxaphobia wrote:

> What am I doing wrong?

First, --reply is a GNU-only, non-standard option and should be avoided if
possible.

Now let's look at what the info page for mv says about --reply:

Note that `--reply=no' has an effect only when `mv' would prompt
without `-i' or equivalent, i.e., when a destination file exists and is
not writable, standard input is a terminal, and no `-f' (or equivalent)
option is specified.

Does this make sense for your case?

--
All the commands are tested with bash and GNU tools, so they may use
nonstandard features. I try to mention when something is nonstandard (if
I'm aware of that), but I may miss something. Corrections are welcome.

Report this thread to moderator Post Follow-up to this message
Old Post
pk
04-03-08 11:26 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Unix Shell Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 09:25 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.