in reply to Re^2: how to kill background process when script exit?
in thread how to kill background process when script exit?
I bet it's those ampersands that are getting in your way. The open statement, when given a string ending with a vertical bar tells perl to try to run the program in the background and redirect the standard output to the opened file stream. So in the first case, it fails because the string didn't end with a vertical bar, so it tried to use it as a filename. The second and third fail because when the shell starts, it then tries to open another process in the background. So you lose control of the child of the child.
Give it a go without the ampersand, and let us know if that doesn't fix it.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: how to kill background process when script exit?
by Allasso (Monk) on Feb 19, 2011 at 23:20 UTC | |
by roboticus (Chancellor) on Feb 19, 2011 at 23:44 UTC | |
by Corion (Patriarch) on Feb 20, 2011 at 00:14 UTC | |
by Allasso (Monk) on Feb 20, 2011 at 01:07 UTC | |
by Corion (Patriarch) on Feb 20, 2011 at 08:15 UTC | |
by Allasso (Monk) on Feb 20, 2011 at 14:43 UTC | |
|