home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / shell / 3689 < prev    next >
Encoding:
Internet Message Format  |  1992-08-29  |  1.3 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!pacbell.com!pacbell!oracle!unrepliable!bounce
  2. Newsgroups: comp.unix.shell
  3. From: plobo@dvlseq.us.oracle.com (Patrick Lobo)
  4. Subject: Re: How to empty a file
  5. Message-ID: <1992Aug29.014925.20596@oracle.us.oracle.com>
  6. Sender: usenet@oracle.us.oracle.com (Oracle News Poster)
  7. Nntp-Posting-Host: dvlseq
  8. Organization: Oracle World HQ, Redwood Shores, California
  9. References: <BtLLps.But@cs.dal.ca> <1992Aug28.051548.16935@ddsw1.mcs.com> <ahn.714982174@ac>
  10. Date: Sat, 29 Aug 1992 01:49:25 GMT
  11. X-Disclaimer: This message was written by an unauthenticated user
  12.               at Oracle Corporation.  The opinions expressed are those
  13.               of the user and not necessarily those of Oracle.
  14. Lines: 22
  15.  
  16. In article <ahn.714982174@ac> ahn@ac.wfunet.wfu.edu (Dave Ahn) writes:
  17. >dattier@ddsw1.mcs.com (David W. Tamkin) writes:
  18. >
  19. >>digdon@ug.cs.dal.ca (Mike Digdon) wrote in <BtLLps.But@cs.dal.ca>:
  20. >
  21. >>| You could also do:
  22. >>| 
  23. >>|     echo > logfile
  24. >
  25. >>That will not leave an empty file; the file will contain one newline and
  26. >>nothing else, but it won't be empty.
  27. >
  28. >Try 'touch logfile'
  29. >-- 
  30. >Dave Ahn
  31.  
  32.  
  33. Touch won't work in this case, because the logfile already exists and 
  34. is of finite size.  The user wants to truncate a pre-existing file to zero
  35. length.
  36.  
  37. pl
  38.