home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / shell / 3748 < prev    next >
Encoding:
Text File  |  1992-09-01  |  1.2 KB  |  36 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!usc!venice!gilmore
  3. From: gilmore@venice.sedd.trw.com (Larry Gilmore)
  4. Subject: Re: How to empty a file
  5. Message-ID: <1992Sep2.003609.9978@venice.sedd.trw.com>
  6. Organization: TRW Systems Engineering & Development Division, Carson, CA
  7. References: <1992Aug28.051548.16935@ddsw1.mcs.com> <ahn.714982174@ac> <1992Sep1.190410.17063@prism.poly.edu>
  8. Date: Wed, 2 Sep 1992 00:36:09 GMT
  9. Lines: 25
  10.  
  11. In article <1992Sep1.190410.17063@prism.poly.edu> kapela@prism.poly.edu (Theodore S. Kapela) writes:
  12. >In article <ahn.714982174@ac> ahn@ac.wfunet.wfu.edu (Dave Ahn) writes:
  13. >>
  14. >>Try 'touch logfile'
  15. >
  16. >This will only leave an empty file if the file does not exist.  If the file
  17. >exists, it will only change the access and modification times.
  18. >
  19. >
  20. >-- 
  21. >..............................................................................
  22. > Theodore S. Kapela                kapela@poly.edu
  23. > Center for Applied Large-Scale Computing    
  24. > Polytechnic University
  25.  
  26. When I had to ensure a zero-length file, I used:
  27.  
  28. cat /dev/null > foofile
  29.  
  30.  
  31. -- 
  32. Larry A. Gilmore             Internet: gilmore@venice.sedd.trw.com
  33. TRW SEDD, DH1/2849
  34. P.O. Box 6213                Phone:    (310)764-3318
  35. Carson, CA 90746             Fax:      (310)764-3946
  36.