Dear visitor, welcome to KDE-Forum.org.
If this is your first visit here, please read the Help. It explains in detail how this page works.
To use all features of this page, you should consider registering.
Please use the registration form, to register here or read more information about the registration process.
If you are already registered, please login here.
Problem with KPRocIO
Hi,
I'd like to run a sequence like this
cat /proc/stats | grep processes | cut -f 2 -d " "
with KProcIO.
KProcIO Proc();
Proc << "cat /proc/stats | grep processes | cut -f 2 -d \" \""
this doesn't work
Proc << "cat" << "/proc/stats" << "| grep processes" << "| cut -f 2 -d \" \""
also doesn't work
even
Proc << "echo Hello" doesn't work.
but
Proc << "echo" << "Hello" works.
How can i run such a command line in order to get its result via stdout ?
Thanks.
RE: Problem with KPRocIO
Just a guess:
Proc << "cat" << "/proc/stats" << "|" << "grep" << "processes" << "|" << "cut" << "-f" << "2" << "-d" << " ";
RE: Problem with KPRocIO
Sorry but that doesn't work too.
RE: Problem with KPRocIO
proc.setUseShell(true)
and use the all-in-one-string variant IIRC.
David Faure, KDE developer, Klaralvdalens-Datakonsult AB.