|
|
|
|
|
|
|
# Library for executing bash commands with captured output
|
|
|
|
|
|
|
|
The output of the bash command is saved in a C++ string.
|
|
|
|
|
|
|
|
|
|
|
|
## Features
|
|
|
|
|
|
|
|
- Execute command send as string
|
|
|
|
- Return string as command response
|
|
|
|
- Thread safe
|
|
|
|
- Throws an exception when cant pipe stream in execute command
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
Just download the latest release and unzip it into your project. You can turn it on with:
|
|
|
|
|
|
|
|
```
|
|
|
|
#include "exec/lib/exec.hpp"
|
|
|
|
using namespace marcelb;
|
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
```c++
|
|
|
|
/**
|
|
|
|
* Run bash command and store output
|
|
|
|
*/
|
|
|
|
string out = exec("ls -lha");
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Print response
|
|
|
|
*/
|
|
|
|
cout << out << endl;
|
|
|
|
```
|
|
|
|
## License
|
|
|
|
|
|
|
|
[APACHE 2.0](http://www.apache.org/licenses/LICENSE-2.0/)
|
|
|
|
|
|
|
|
|
|
|
|
## Support & Feedback
|
|
|
|
|
|
|
|
For support and any feedback, contact the address: marcelb96@yahoo.com.
|
|
|
|
|
|
|
|
## Contributing
|
|
|
|
|
|
|
|
Contributions are always welcome!
|
|
|
|
|
|
|
|
Feel free to fork and start working with or without a later pull request. Or contact for suggest and request an option.
|
|
|
|
|