Re: Bash script problem
Am 17.05.2005 um 11:50 schrieb Markus.Grunwald@pruftechnik.com:
> I have a problem with a bash script. The script (example) is very simple:
>
> #!/bin/bash
>
> echo hello
> ssh PT-AGCMLX1 "while true; do date; sleep 10s; done"
[..]
> How can I change my script so that it kills all its child processes, if it
> is killed itself ? I tried to use the "trap" function of bash, but it
> never used the correct pid...
Have you tried to use "exec ssh PT-..." instead?
"exec ssh" will replace the shell process with ssh, so there will be
no shell process left after you've killed the ssh process.
Regards,
Dennis
--
Send personal mail to dennis@... only. Off-list
mails to lists@stosberg.net will not reach me.
Reply to: