...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::process::shell
// In header: <boost/process/shell.hpp> unspecified shell;
The shell property enables to launch a program through the shell of the system.
system("gcc", shell);
The shell argument goes without any expression. The operator() is overloaded, to obtain the path of the system shell.
auto shell_cmd = shell(); //avoid exceptions std::error_code ec; shell_cmd = shell(ec);
![]() |
Note |
---|---|
Launching through the shell will NOT provide proper error handling, i.e. you will get an error via the return code. Executing shell commands that incorporate unsanitized input from an untrusted source makes a program vulnerable to shell injection, a serious security flaw which can result in arbitrary command execution. For this reason, the use of |