home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / wizards / 4702 < prev    next >
Encoding:
Internet Message Format  |  1992-11-15  |  1.3 KB

  1. Xref: sparky comp.unix.wizards:4702 comp.unix.shell:4717
  2. Newsgroups: comp.unix.wizards,comp.unix.shell
  3. Path: sparky!uunet!destroyer!mudos!mju
  4. From: mju@mudos.ann-arbor.mi.us (Marc Unangst)
  5. Subject: Re: The Problem with UNIX
  6. Message-ID: <Bxry40.I04@mudos.ann-arbor.mi.us>
  7. Date: Sun, 15 Nov 1992 20:26:23 GMT
  8. References: <1992Nov11.194557.16258@yarc.uucp> <1992Nov13.091914.6799@thunder.mcrcim.mcgill.edu> <1992Nov14.153857.1666@global.hacktic.nl>
  9. Organization: The Programmer's Pit Stop, Ann Arbor MI
  10. Lines: 25
  11.  
  12. In article <1992Nov14.153857.1666@global.hacktic.nl> peter@global.hacktic.nl (Peter Busser) writes:
  13. >I did just that with bash and it didn't complain. But yet, echo is often a
  14. >built-in command. It complained about 'cat a b >b' but didn't complain about
  15. >'cat a b|cat>b' so it's not perfect.
  16.  
  17. You fail to see the point.  It's useless for cat to complain, because
  18. once cat gets to run "b" has already been clobbered by the shell.  Try
  19.  
  20. $ echo foo >foo
  21. $ echo bar >bar
  22. $ cat foo
  23. foo
  24. $ cat bar
  25. bar
  26. $ cat foo bar >bar
  27. cat: input/output files 'bar' identical
  28. $ cat bar
  29. foo
  30.  
  31. -- 
  32. Marc Unangst, N8VRH         | "There are two ways to solve this problem:
  33. mju@mudos.ann-arbor.mi.us   | the hard way, and the easy way.  Let's start
  34.                             | with the hard way."
  35.                             |   - W. Scheider, from a Physics lecture
  36.