| Home | Libraries | People | FAQ | More

## Global shell

boost::process::shell

## Synopsis

    // In header: <boost/process/shell.hpp>

    unspecified shell;

## Description

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.

| Note
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 `shell` is strongly discouraged in cases where the command string is constructed from external input: