[comp.binaries.ibm.pc.d] Unix-like mv commands

feg@clyde.ATT.COM (Forrest Gehrke) (06/23/88)

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

wnp@dcs.UUCP (Wolf N. Paul) (06/25/88)

In article <28547@clyde.ATT.COM> feg@clyde.ATT.COM (Forrest Gehrke) writes:
>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.

I just tried this on my System V UNIX:

  $ touch test
  $ ls bogusdir
  bogusdir not found
  $ mv test bogusdir/
  $ ls -l bogusdir
  -rw-r--r--   1 wnp      user           0 Jun 25 09:06 bogusdir
  $

Thus the PICNIX mv command seems to behave just like UNIX System V.
The problem here seems to be the assumption that there is something
called "UNIX" which is clearly defined. 

Well, I personally have worked on at least three different flavors of
UNIX, and THEY ALL BEHAVE SLIGHTLY DIFFERENTLY!

The PICNIX documentation makes it very clear that the commands are 
designed to be largely System V compatible, and in the case of mv that
seems to be the case.

I had noticed that unlike real System V, the MKS toolkit commands 
do not tolerate trailing backslashes on directory names, and I hope 
someone at MKS reads this and gets it fixed (Gerry, Trevor, are you out
there?).

Anyway, folks, when you complain that such and such a command is not
like UNIX, tell us WHICH UNIX you are referring to. That could save us
a lot of unnecessary discussion. And check the docs, to see what
they claim, before complaining.
-- 
Wolf N. Paul * 3387 Sam Rayburn Run * Carrollton TX 75007 * (214) 306-9101
UUCP:     killer!dcs!wnp                 ESL: 62832882
DOMAIN:   wnp@dcs.UUCP                   TLX: 910-380-0585 EES PLANO UD