wibble::sys::ShellCommand Class Reference

Execute a shell command using /bin/sh -c. More...

`#include <exec.h>`

Inheritance diagram for wibble::sys::ShellCommand:
[legend]
Collaboration diagram for wibble::sys::ShellCommand:
[legend]

## Public Member Functions

| ShellCommand (const std::string &cmd)
Public Member Functions inherited from wibble::sys::Exec
virtual | ~Exec ()
| Exec (const std::string &pathname)
| Create a new object that will execute program ‘program’. More...
void | importEnv ()
| Import the current environment into env. More...
void | exec ()
| exec the program, never returning if all goes well More...
Public Member Functions inherited from wibble::sys::ChildProcess
| ChildProcess ()
virtual | ~ChildProcess ()
void | setExec (std::string command)
| Instead of calling the main() function of this class, execute an external command. More...
pid_t | fork ()
| For a subprocess to run proc. More...
void | setupRedirects (int *stdinfd=0, int *stdoutfd=0, int *stderrfd=0)
pid_t | forkAndRedirect (int *stdinfd=0, int *stdoutfd=0, int *stderrfd=0)
pid_t | pid () const
| Get the pid of the child process or (pid_t)-1 if no child is running. More...
bool | running ()
int | exitStatus ()
void | waitForSuccess ()
int | wait (struct rusage *ru=0)
| Wait for the child to finish, returning its exit status and optionally storing resource usage informations in ‘ru’. More...
void | kill (int signal)
| Send the given signal to the process. More...

## Additional Inherited Members

Public Attributes inherited from wibble::sys::Exec
std::string | pathname
| Filename or pathname of the program to execute. More...
std::vector< std::string > | args
| Arguments for the process to execute. More...
std::vector< std::string > | env
| Custom environment for the child process, if envFromParent is false. More...
bool | envFromParent
| True if the environment is to be taken from the parent, false if it is explicitly provided in env. More...
bool | searchInPath
| Set to true if the file is to be searched in the current $PATH. More...
Protected Member Functions inherited from wibble::sys::Exec
virtual int | main ()
| Used to run the program as a child process, if one of the ChildProcess::fork functions is called. More...
virtual void | spawnChild ()
| On Windows, it's impossible to fork(), but if you were to fork+exec, it's not all lost. More...
Protected Member Functions inherited from wibble::sys::ChildProcess
void | waitError ()
void | setupPipes ()
void | setupPrefork ()
void | setupChild ()
void | setupParent ()
Protected Attributes inherited from wibble::sys::ChildProcess
pid_t | _pid
int | pipes [3][2]
int * | _stdin
int * | _stdout
int * | _stderr
int | m_status
bool | m_doExec
std::string | m_command

## Detailed Description

Execute a shell command using /bin/sh -c.

## Constructor & Destructor Documentation

## ShellCommand()

wibble::sys::ShellCommand::ShellCommand | ( | const std::string & | cmd | ) |

inline

References wibble::sys::Exec::args, wibble::sys::Exec::envFromParent, and wibble::sys::Exec::searchInPath.

The documentation for this class was generated from the following file:

- exec.h