in reply to Re^2: Forking an operative terminal
in thread Forking an operative terminal
You can get rid of the defunct processes by setting $SIG{CHLD} = 'IGNORE' in the parent. Also, you should use sh -c instead of bash -c in "bash -c '$command; bash'", since only sh is guaranteed to exist.
And the user's shell can be found with this piece of code:
my ($shell, $uid); while (($uid, $shell) = (getpwent)[2,8]) { last if $uid == $<; } say $shell;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Forking an operative terminal
by Anonymous Monk on Dec 31, 2012 at 19:06 UTC | |
|
Re^4: Forking an operative terminal
by perlgrim (Initiate) on Jan 01, 2013 at 12:13 UTC |