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