[plug] mv (move) problem/bug

Russell Steicke r.steicke at bom.gov.au
Fri Jan 14 11:41:18 WST 2005


On Fri, Jan 14, 2005 at 10:14:15AM +0800, Timothy White wrote:
> I appear to have found a bug in mv. Ether that I am not understanding
> the behaviour.
> This works with multiple versions with the latest I've tried being 5.0.91.
> Basically I have a script that needs to call mv to move a file IF the
> file doesn't exist in the destination.
> I use 'mv --reply=no' and 'mv -i --reply=no' and it still overwrites the
> existing file.

You could simplify this with

  [ -f dstfile ] || mv srcfile dstfile

> Am I doing something wrong? I've tried setting noclobber under bash but
> it still happens.

noclobber doesn't apply to what mv or other things will do, only to
what the shell does with redirection to files that exist.





-- 
Russell Steicke

-- Fortune says:
Try to remove the color-problem by restarting your computer several times.
	-- Microsoft-Internet Explorer README.TXT



More information about the plug mailing list