home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / question / 10730 < prev    next >
Encoding:
Text File  |  1992-09-04  |  1.1 KB  |  37 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!zaphod.mps.ohio-state.edu!rpi!fitzgb
  3. From: fitzgb@mml0.meche.rpi.edu (Brian Fitzgerald)
  4. Subject: Re: changing name of core file
  5. Message-ID: <q+zyzb=@rpi.edu>
  6. Nntp-Posting-Host: mml0.meche.rpi.edu
  7. Organization: Rensselaer Polytechnic Institute, Troy, NY
  8. References: <1992Sep3.210650.65595@evolving.com>
  9. Date: Fri, 4 Sep 1992 15:26:09 GMT
  10. Lines: 25
  11.  
  12. Dan Stanger writes:
  13. >does anyone know how to change the name of the core file that will be
  14. >created if a program fails.  we have several programs running in the
  15.  
  16. Not without kernel sources.
  17.  
  18. >same directory so if more than one of them fails the core file from
  19. >one overwrites the other.  we would like to change the name to
  20. >program.core or somthing like that.
  21.  
  22. Run the program as:
  23.  
  24. program ; mv core program.core
  25.  
  26. When "program" exits, then if "core" exists, it is renamed.
  27.  
  28. This is the idea, anyway.  You want a fancier shell script.
  29.  
  30. #!/bin/sh
  31. program || test -f core && mv core program.core
  32.  
  33. is a little better, but there's no assurance that you are renaming
  34. the right core file.
  35.  
  36. Brian
  37.