C++ (Qt)#include <QCoreApplication>#include <QProcess>#include <QDebug> int main( int argc, char *argv[] ){ QCoreApplication app( argc, argv ); QProcess process; process.start( "/bin/bash" ); process.waitForStarted(); process.write( "ls\n" ); process.waitForReadyRead(); qDebug() << process.readAll(); process.write( "ls /\n" ); process.waitForReadyRead(); qDebug() << process.readAll(); process.write( "exit\n" ); process.waitForFinished(); return 0;}