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

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!cs.utexas.edu!uwm.edu!linac!att!news.cs.indiana.edu!nstn.ns.ca!cs.dal.ca!ug.cs.dal.ca!digdon
  3. From: digdon@ug.cs.dal.ca (Mike Digdon)
  4. Subject: Re: How to empty a file
  5. Message-ID: <BtLLps.But@cs.dal.ca>
  6. Sender: usenet@cs.dal.ca (USENET News)
  7. Nntp-Posting-Host: ug.cs.dal.ca
  8. Organization: Math, Stats & CS, Dalhousie University, Halifax, NS, Canada
  9. References: <17g4kbINN4bm@seven-up.East.Sun.COM>
  10. Date: Wed, 26 Aug 1992 15:58:39 GMT
  11. Lines: 18
  12.  
  13. In article <17g4kbINN4bm@seven-up.East.Sun.COM> ltaylor@blinky.East.Sun.COM writes:
  14. >
  15. >>> I'd like to empty a log file after extracting what I need from it so that
  16. >>> the next day's data can fill it up a-fresh.  The file must exist after
  17. >>> emptying it.
  18. >
  19. >cp /dev/null <logfile>
  20. >
  21. >/laura
  22.  
  23. You could also do:
  24.  
  25.     echo > logfile
  26.  
  27. -- 
  28.          Mike Digdon - Vice Prez DSCSS - Dalhousie University
  29.              digdon@ug.cs.dal.ca  -- Halifax, NS
  30.          - Real programmers never work nine to five -
  31.