R
Russ Jones
If I use an exec() statement with only one parm, like this:
exec('/some/pgm -parm parm 2>/dev/null');
everything works fine, and STDERR goes to /dev/null just like I want it to,
because this form of the call sees the 2> shell metacharacters and passes
them to the shell for execution.
But I prefer to use the list method of calling exec() because of the better
security:
push(@parms,'-parm','parm','2>/dev/null');
exec("/some/pgm",@parms);
Unfortunately, the very reason that I like the list method, that it doesn't
use the system shell, also makes the "2>/dev/null" part not work, because
that's not part of the /some/pgm, it's part of the shell.
Is there a way I can make STDERR go to /dev/null and still use the list
method of the call?
Thanks for looking,
Russ Jones
exec('/some/pgm -parm parm 2>/dev/null');
everything works fine, and STDERR goes to /dev/null just like I want it to,
because this form of the call sees the 2> shell metacharacters and passes
them to the shell for execution.
But I prefer to use the list method of calling exec() because of the better
security:
push(@parms,'-parm','parm','2>/dev/null');
exec("/some/pgm",@parms);
Unfortunately, the very reason that I like the list method, that it doesn't
use the system shell, also makes the "2>/dev/null" part not work, because
that's not part of the /some/pgm, it's part of the shell.
Is there a way I can make STDERR go to /dev/null and still use the list
method of the call?
Thanks for looking,
Russ Jones