Code Comments
Programming Forum and web based access to our favorite programming groups.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>
Post Follow-up to this messageAllodoxaphobia 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.
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.