This is needlessly restrictive. It should be >= instead of ==. That way you can avoid running the given command through the shell.
system@command;
It may be useful to use system { $command[0] } @command here instead, which will ensure the command is never run under shell. This loses a bit of convenience if the user did want to run the command under shell, but prepending sh -c ... to the arguments is no big deal and this keeps the program from containing a hidden “oops, you got shell when you didn’t mean to” trap.
But this is more subjective than the other change.
This is needlessly restrictive. It should be
>=
instead of==
. That way you can avoid running the given command through the shell.It may be useful to use
system { $command[0] } @command
here instead, which will ensure the command is never run under shell. This loses a bit of convenience if the user did want to run the command under shell, but prependingsh -c ...
to the arguments is no big deal and this keeps the program from containing a hidden “oops, you got shell when you didn’t mean to” trap.But this is more subjective than the other change.
Good suggestions, thanks. I quickly threw this together to test the signal mechanism, didn't pay attention to the arguments that much.