home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.wizards
- Path: sparky!uunet!ferkel.ucsb.edu!taco!gatech!darwin.sura.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnewsk!cbnewsj!dwex
- From: dwex@cbnewsj.cb.att.com (david.e.wexelblat)
- Subject: Re: The Problem with UNIX
- Organization: AT&T
- Date: Fri, 13 Nov 1992 17:48:47 GMT
- Message-ID: <1992Nov13.174847.3882@cbnewsj.cb.att.com>
- References: <1992Nov11.210729.11676@cs.wisc.edu> <BARNETT.92Nov12092045@grymoire.crd.ge.com> <1992Nov12.231845.14014@cs.wisc.edu>
- Lines: 59
-
- In article <1992Nov12.231845.14014@cs.wisc.edu> so@brownie.cs.wisc.edu (Bryan S. So) writes:
- > Concerning "cat a b > b", barnett@crdgw1.ge.com writes:
- >
- > >It has been solved. There are at least two solutions:
- > > 1) Educate the user. After all the system did exactly what
- > > the user told it to do.
- > > 2) in csh/tcsh, do "set noclobber"
- > >
- > >grymoire% set noclobber
- > >grymoire% touch a b
- > >grymoire% cat a b >b
- > >b: File exists.
- > >--
- > >Bruce Barnett <barnett@crd.ge.com> uunet!crdgw1!barnett
- >
- > No, the above are not solutions.
- >
- > 1. We should assume some stubborn users cannot be educated. I
- > claim without proof such users exist.
- >
- > 2. set noclobber is not a solution because a solution should
- > prepend a to b.
- >
- > I propose a real solution to this problem. Change the internal
- > policy of UNIX, so that when any file is used as both input and
- > output, like
- >
- > cat a b > a
- > or cat a b > b
- >
- > UNIX should read and buffer all input before opening the output
- > with "w".
- >
- >
- > Bryan
-
- Get real. In your example, replace /bin/cat with /bin/echo:
-
- /bin/echo a b > b
-
- What should "unix" do here? You are confusing the OS, the shell, and
- the program. The various responsibilities are distributed. Cripe -
- MS-DOG has redirection, and will do the same screwup for commands that
- are not built into COMMAND.COM. I doubt that JCL protects you either.
-
- Or would you rather have no I/O redirection, and force all the programs
- to do all the I/O themselves? How would you handle pipelines?
-
- As soon as you try to protect users from themselves, you destroy
- the usefulness of the system. Who ever said that Unix is supposed to
- be the "One True OS" (other than USL :->)? Don't destroy the usefulness
- of my OS because people who shouldn't be using it are involved.
-
- --
- David Wexelblat <dwex@mtgzfs3.att.com> (908) 957-5871
- AT&T Bell Laboratories, 200 Laurel Ave - 4B-421, Middletown, NJ 07748
-
- "The meaning of life? That's simple. Try to be happy, try not to hurt
- other people, and hope to fall in love." -- Mallory Keaton
-