home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / shell / 3715 < prev    next >
Encoding:
Text File  |  1992-08-31  |  970 b   |  25 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!uunet.ca!geac!r-node!druid!darcy
  3. From: darcy@druid.uucp (D'Arcy J.M. Cain)
  4. Subject: Re: How to empty a file
  5. Message-ID: <1992Aug31.154104.14250@druid.uucp>
  6. Date: Mon, 31 Aug 1992 15:41:04 GMT
  7. References: <BtLLps.But@cs.dal.ca> <1992Aug28.051548.16935@ddsw1.mcs.com> <ahn.714982174@ac>
  8. Organization: D'Arcy Cain Consulting
  9. Lines: 14
  10.  
  11. ahn@ac.wfunet.wfu.edu (Dave Ahn) writes:
  12. >Try 'touch logfile'
  13.  
  14. That doesn't empty a file.  It creates an empty one if a file of that name
  15. doesn't exist.  You could do "rm file; touch file" but this is not only
  16. more complicated than necessary it also doesn't empty a file but rather
  17. it creates an empty file of the same name as the original - a subtle
  18. difference when links are involved.
  19.  
  20. -- 
  21. D'Arcy J.M. Cain (darcy@druid.com)  |
  22. D'Arcy Cain Consulting              |   There's no government
  23. Toronto, Ontario, Canada            |   like no government!
  24. +1 416 424 2871          DoD#0082   |
  25.