home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / question / 14756 < prev    next >
Encoding:
Internet Message Format  |  1992-12-17  |  933 b 

  1. Path: sparky!uunet!think.com!barmar
  2. From: barmar@think.com (Barry Margolin)
  3. Newsgroups: comp.unix.questions
  4. Subject: Re: cat a > a , getting it straight
  5. Date: 17 Dec 1992 06:45:16 GMT
  6. Organization: Thinking Machines Corporation, Cambridge MA, USA
  7. Lines: 12
  8. Message-ID: <1gp7lsINNlok@early-bird.think.com>
  9. References: <1992Dec17.020805.28043@news.acns.nwu.edu>
  10. NNTP-Posting-Host: gandalf.think.com
  11.  
  12. In article <1992Dec17.020805.28043@news.acns.nwu.edu> navarra@casbah.acns.nwu.edu (John Navarra) writes:
  13. >Why does appending a to a with cat not work but wc a >> a does produce
  14. >the output from wc that is expected?  
  15.  
  16. Because cat checks whether the input and output are the same file.  When
  17. this is so, it prints the warning message and exits.  Wc (and most other
  18. programs) doesn't check, so the expected thing happens.
  19. -- 
  20. Barry Margolin
  21. System Manager, Thinking Machines Corp.
  22.  
  23. barmar@think.com          {uunet,harvard}!think!barmar
  24.