home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / 3b1 / 4126 < prev    next >
Encoding:
Internet Message Format  |  1992-12-28  |  1.4 KB

  1. Path: sparky!uunet!nwnexus!ole!rwing!eskimo!ape
  2. From: ape@eskimo.com (Mark Newland)
  3. Newsgroups: comp.sys.3b1
  4. Subject: Re: Shell program problem
  5. Message-ID: <1992Dec28.051444.24418@eskimo.com>
  6. Date: 28 Dec 92 05:14:44 GMT
  7. References: <1992Dec24.102302.19922@eskimo.com> <1992Dec26.023658.23589@yenta.alb.nm.us>
  8. Organization: -> ESKIMO NORTH (206) For-Ever <-
  9. Lines: 27
  10.  
  11. dt@yenta.alb.nm.us (David B. Thomas) writes:
  12.  
  13. >ape@eskimo.com (Mark Newland) writes:
  14.  
  15. >>mount /dev/fp021 /mnt
  16. >>/mnt/$PROGRAM
  17. >>umount /dev/fp021
  18.  
  19. >>[problem: does not unmount after running program]
  20.  
  21. >I could be totally off here, but if you were to type the interrupt key at
  22. >any time during $PROGRAM, the script would break.  $PROGRAM might still
  23. >finish (if it catches the interrupt), but the rest of your parent script
  24. >won't run.  You could use echo statements to verify this.
  25.  
  26. >Then, if it turns out that that's the problem, just add
  27. >    trap "" 2
  28. >to the beginning, and
  29. >    trap 2
  30. >to the end.  That way, you're ignoring interrupts.
  31.  
  32. Your right.  I did a little experimenting in this the other day and determined
  33. this to be true.  However, thanks to you, I hopefully found a way to correct
  34. it.  Then there is the problem of running programs that react in the same
  35. way as 'exec $PROGRAM' in that the shell no longer exist when you get back to
  36. it.  I can use fork (I think) to get around this.  I don't really think trap
  37. will fix it.  Is there another way?  At least my main concern is solved.
  38.