

This is actually not a good approach.
The command is passed as a string to the Bourne shell and is thus subject to the vagaries of the interpreter breaking it apart into command + args etc, i.e. the programmer has to perform quoting and escaping, an error-prone undertaking.
And the target is always sh
although one may not want to pass through sh
at all, just start an arbitrary process with a fixed list of arguments.
Compare with Perl's system
:
https://perldoc.perl.org/functions/system.html#exec-LIST
or with Java's Runtime.exec()
:
https://docs.oracle.com/en/java/javase/14/docs/api/java.base/java/lang/Runtime.html
There is package "by_unix" ("an elegance layer to calling unix commands") to call unix commands more directly (I haven't tried it)