$cmd = "/bin/su $user -c '/usr/bin/passwd $user; exit \$?'";
as your constructed $cmd, although I'm pretty sure that su sets its own exit status to that of the invoked program.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
In reply to Re: Capture output from command under su
by shmem
in thread Capture output from command under su
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |