Two things: first, what you called an "informational message" i did call a "diagnostic message". In this regard i'd call the two expressions synonymous.
Second, and more important: no, the message is not "reporting on shell's activity" at all, because at this point the shell has no activity. When you issue the command:
mv A B
(regardless of the files involved and if it succeeds or not) what happens is: the shell first interprets the command line. If you happened to use a variable for a filename like this:
file="/some/file"
mv $file B
the shell would expand the variable to its content first.
Also, wildcards would be expanded. You didn't use any, but suppose your command would be
ls -l over*
then the shell would expand the "over*" to a list of filenames/directory names which start with "over". After such an expansion the command would look like this:
ls -l overwrite overwrite2
Also the PATH variable is used to locate "mv", which you entered without a path. Because perhaps "/usr/bin" is part of the PATH variable the shell calls "/usr/bin/mv" when you enter "mv". If "mv" would be a shell function then this would be executed instead. The same for an alias, etc.. So, after all these transformations, something like the following is in fact executed:
/usr/bin/mv A B
In fact, executed is only the binary: "/usr/bin/mv". The shell will pass the parameters you gave at the command line already parsed (that is: broken into pieces one argument each) to the executable ("/usr/bin/mv"). At this point, the shell passes over to the executable and this runs on its own. The shell does nothing.
Only when the executable ends, it sets a "return code" and the shell sets its special variable "$?" to this return code. This is why i suggested to execute the 4 commands in post #5: the return code (or error code, another synonym) is set anew after each execution of a binary so that "$?" always holds the return code of the last command.
All this means: the "...not overwritten" is not a message from the shell, but in fact a message from "mv" which tells you what is going on. You could also issue a echo $?
directly after and find out what the error code is - it is perhaps non-zero when the file could not be overwritten because of the -n
switch.
I hope this helps.
bakunin