netstat -n | awk '{print $ 5}' A simple construction displays ip: port - it works fine.

Upon attempt:

process.start("netstat -n | awk '{print $5}'"); process.waitForFinished(); QByteArray result = process.readAll(); 

I get cookies, netstat -n worked, but awk did not catch, just got the output from the netstat command.

    1 answer 1

    Logically, the team worked. QProcess executes one process, and you try to execute the sequence. On SO, this case is analyzed and explained.

    In short - you need to run the shell and give it a set of commands.

    PS the command you specified returns not only the ip: port set, but also the State , DGRAM , SEQPACKET , STREAM and more. (OS: Fedora 20).