Path: utzoo!utgpu!water!watmath!clyde!feg
From: feg@clyde.ATT.COM (Forrest Gehrke)
Newsgroups: comp.binaries.ibm.pc.d
Subject: Unix-like mv commands
Keywords: Some aren't so like
Message-ID: <28547@clyde.ATT.COM>
Date: 23 Jun 88 15:47:54 GMT
Organization: AT&T Bell Labs, Whippany NJ
Lines: 35

There have been several rebuttals on the net and via email
to my posting that the picnix mv command is not
like Unix.  They all told me what I now know: 
If the syntax is given like this:

   mv filename \gooddir\bogusdir\anyfilename

this command will indeed report it cannot create bogusdir.

But if the syntax is like this:

   mv filename \gooddir\bogusdir\

then this command will treat bogusdir as the new name 
for the file and move it under gooddir, ignoring the backlash,
oblivious that bogusdir was given as a DIRECTORY name.

Unix, on the other hand, recognizes this to be a request to
move filename to a directory and reports it cannot create it.  
And, if bogusdir DID exist, it moves filename under it, 
using the file's original name.  (BTW, the MKS mv command
emulates Unix a little more closely; it balks, however,
at moving a file, even if it exists, if a trailing backslash
to the directory path is used.  But if not used, it's a catch-22.
If the last directory named in the path is bogus it correctly
chooses that for the new name of the moved file).

Conclusion: these commands are only partially Unix-like.
On the other hand....Chuck Forsberg's mv.com which was
put on the net around the turn of the year emulates
Unix exactly.  Its error messages don't always fit
the situation but it does what is expected. Nor is it
fussy about which backslash is used.

Forrest Gehrke