#ifndef SHELL_HPP #define SHELL_HPP #include #include /*! \file shell.hpp * @brief Shell functionality and interaction */ namespace ztd { //! @brief Execute a shell command and retrieve its output /*! @param command Shell command to execute @param to_console Output to console @return Output of the command @see system(), pclose() */ std::string sh(const std::string& command, bool to_console=false); //! @brief popen C function with added pid functionality /*! @param pid Pointer to an @a int in which the process's pid will be stored @see popen(), pclose() */ FILE* popen2(const char* command, const char* type, int* pid); //! @brief pclose C function with added pid functionality /*! @param pid Pid of the opened process @see popen(), pclose() */ int pclose2(FILE* fp, pid_t pid); // class shell // { // public: // private: // }; } #endif //SHELL_HPP