system_safe is a safe replacement for system(3) provided by the libc. system_safe parses the command
string and runs the command directly, without using a shell. The command must be specified as an absolute
pathname. system_safe does not support variables as argument.
Command arguments in args are delimited by space characters (blank, tabs or new lines). Single or double
quotes can be used to delimitate command arguments including spaces and a non quoted backslash (\) is the
escape character to protect the next char.
system_execsa is like system_safe supporting also variables as arguments. When an argument of a command
is a dollar sign followed by a name (e.g. $USER) s2argv puts the output of the s2argv_getvar function
instead. (It is possible for example to assign s2argv_getvar=getenv. For security reasons, the function
is NULL by default and all variables get replaced with an empty string. Programmers can use their own
custom function instead)
In system_execsp the executable file is sought using the PATH environment variable as explained for
execlp(3).
system_execs requires the path of the executable to be specified as its first parameter so it does not
use the PATH environment variable.
system_execsr, system_execsrp and system_execsra works as their couterparts without the 'r', but they
permit the redirection of standard input, output and error streams. Their last parameter is an array of
three integers. The standard input of the command will be redirected to redir[0] if it is positive, the
standard output to redir[1] if it is not negative and different from 1, the standard error to redir[2] if
it is not negative and different from 2.
system_execsra does not use the PATH variable, argv[0] must be specified as a full pathname.
system_nosh, system_execsqp, system_execsqa, system_execsqrp and system_execsqra can run sequences of
commands separated by semicolons (;). The first command returning a non-zero exit status breaks the
sequence.
system_nosh is an almost drop in replacement for system(3) provided by the libc. (system_execsqp and
system_nosh are synonyms).