Here is the script and I have singled out the block that I believe is causing the recent problem
mv sourcefile targetfile > /dev/null
I know for a fact that mv will by default overwrite without asking for confirmation if the destination file exists. Therefore, the script (above) is right.
mv: try to overwrite `targetfile', overriding mode 0644 (rw-r--r--)?
The only time it will prompt/ask for confirmation to overwrite is with an –i option, which in this case is not used. It is not always happening. Just pops up once in a while
So, why is it behaving this way?
This is my mv version
mv (GNU coreutils) 8.12
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Mike Parker, David MacKenzie, and Jim Meyering.