*BSD News Article 13657


Return to BSD News archive

Newsgroups: comp.os.386bsd.bugs
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!elroy.jpl.nasa.gov!usc!cs.utexas.edu!hellgate.utah.edu!fcom.cc.utah.edu!cs.weber.edu!terry
From: terry@cs.weber.edu (A Wizard of Earth C)
Subject: Re: patch for bin/rm/rm.c
Message-ID: <1993Mar30.021025.4126@fcom.cc.utah.edu>
Sender: news@fcom.cc.utah.edu
Organization: Weber State University  (Ogden, UT)
References: <1993Mar24.222133.14022@fcom.cc.utah.edu> <GDAY.93Mar26114912@ignatz.inde.bc.ca> <1993Mar26.223114.1728@coe.montana.edu>
Date: Tue, 30 Mar 93 02:10:25 GMT
Lines: 43

In article <1993Mar26.223114.1728@coe.montana.edu> osyjm@cs.montana.edu (Jaye Mathisen) writes:
>In article <GDAY.93Mar26114912@ignatz.inde.bc.ca> gday@ignatz.inde.bc.ca (Gordon Day) writes:
>>
>>>>>"terry" == A Wizard of Earth C <terry@cs.weber.edu> writes:
>>
>>First of all, only case 1 is inconsistent with cases 2 and 3.
>>Secondly, just because SunOs is inconsistent does not mean that they
>>don't have the right idea.  I find it extremely useful to be able to
>>do something like...
>>
>>mv bar/* foo/
>>
>> ...knowing that the command will _fail_ if foo is not a directory.
>
>huh?  in any mv command I use, (and I will admit to not following this
>discussion in its entirety), if there's more than 2 arguments to mv,
>the last one has to be a dir...

Gordon's right in the case that "bar/*" expands to a single file which
exists; HOWEVER, I'd be more likely to support his argument if there
were no such command as "set noclobber".  If it's anyones job to keep
you from typos, it's the shells, not the OS, which is just there to
provide system services and do what you tell it, not what you mean.

This protection is adequately handled by an "mv" builtin in a shell
that stats the terminal argument if it has a trailing slash and ensures
it is a directory, failing otherwise.

In the limit, mv is a synonym for link/unlink, neither of which should be
semantically loaded in any case.


					Terry Lambert
					terry@icarus.weber.edu
					terry_lambert@novell.com
---
Any opinions in this posting are my own and not those of my present
or previous employers.
-- 
-------------------------------------------------------------------------------
                                        "I have an 8 user poetic license" - me
 Get the 386bsd FAQ from agate.berkeley.edu:/pub/386BSD/386bsd-0.1/unofficial
-------------------------------------------------------------------------------