> ksh children won't die ; exec doesn't work properly (solution)

> ksh children won't die ; exec doesn't work properly (solution)

Post by Tony J Yeat » Wed, 28 Apr 1993 04:10:45



I traced my exec problem to the tee command:-

        exec next_script | tee log

replacing this with:-

        exec next_script | tee -i log

did the trick.

I'm not really sure why the child processes did not die with
the parent though (I guess tee got killed too soon for ksh's
liking).  If anybody can explain how/why this occured, I'd be
interested to hear - I've tried to explain it away, but I can't
to my satisfaction  (BTW I'm guessing that this problem is what
tee's -i option was created for).

--
"My mule don't like you laughin'"

 
 
 

1. ksh children won't die ; exec doesn't work properly; ksh -p

I'm having problems with Korn shell's exec ...I have converted
some old csh scripts to ksh, which seems to have worked fine,
except for two problems:-

(1) When I kill the parent process - the child processes do not
all die!!! (This one is driving me up the wall).  

Complication: I need to keep one child alive (I use nohup ... & for this)
As the children did not die with their parent, I tried to
kill them in the parent's interupt routine with kill -hup 0
- unfortunately this results in an infinite loop into the
interupt routine ...of course!

(2) When I exec another ksh script, instead of overwriting
the current process - a child process is spawned....why
for heaven sake???

One more question.  What exactly does ksh -p do for me (I thought
it just prevent the ksh reading my .profile, and so would
be good to place on the first line of my scripts, however according
to "Unix Desktop Guide to the Korn Shell" ( a better book than
Korn book for most things IMHO) it described this option as
"Set protected mode" but fails to elaborate further.

I'd be grateful for any help or suggestions.  (E-mail response
would be preferred, but I'll try to check back here.)

--
"As the leader in the cellular industry and a company that places top priority
on the interests and concerns of our customers and the public, we intend to
address these concerns in a straightforward, responsible manner.
..First, let me assure you that all of our products are safe."- Pres. Motorola GSS

2. Booting using NT Boot Loader

3. ksh ': >a >b' -vs- '>a >b' re speed

4. asus a7v266/geforce3ti500 problem

5. SOLUTION: hard disk doesn't work properly

6. FreeBSD and ISDN -- final analysis?

7. PPP doesn't die, it just doesn't work anymore

8. "link_unix" fail <- Error msg meaning ?

9. 'less' command doesn't work properly in searching strings...

10. 'su -c' doesn't work properly?

11. Need 'exec.h' file or 'struct exec' definition

12. Even 'cat file >/dev/lp0' doesn't work

13. TOSS_OUTPUT=' >/dev/null' doesn't work