u r executing commands using QProcess the wrong way
try this:
arguments << "-c" << "ifconfig eth0 | head -n 2 \ | sed 'N;s/\n/ /;N;s/\n/ /' | awk '{print $7 " " $9 " " $5}' \ | sed -e 's/addr://g' -e 's/Mask://g'";
process->start(prog , arguments);
process->waitForFinished();
qDebug() << tmp;
QString prog = "/bin/bash";//shell
QStringList arguments;
arguments << "-c" << "ifconfig eth0 | head -n 2 \ | sed 'N;s/\n/ /;N;s/\n/ /' | awk '{print $7 " " $9 " " $5}' \ | sed -e 's/addr://g' -e 's/Mask://g'";
QProcess* process = new QProcess(this);
process->start(prog , arguments);
process->waitForFinished();
QString tmp = process->readAll();
qDebug() << tmp;
To copy to clipboard, switch view to plain text mode
like this, u can run any command that u can run on a normal shell. just change the second argument in the "arguments" stringlist.. if it doesnt work, break commands and see if the results are right and then move forward..hopefully, this will work anyway
Bookmarks