I am using QT in a windows (do not know if that matters) application and want to start some process from my application using QProcess
.
(actually through a qtscript wrapper that uses QProcess
)
This seems to work but i have problems when using more advanced command lines like connecting programms using pipes.
If i start a process using the following program lines:
QProcess proc;
QString command = "grep \"false negatives\" test.txt | cut -f2";
proc.start(command);
The grep command complains that it could not find the file "2". so obviously the command line is not interpreted as i would expect it to do.
if i prefix a cmd /C
to the command it works well but this obviously is not OS independent anymore and may have some additional caveats regarding command line parameter.
Is there any Qt like way to handle that and force Qt to use some default command line interpreter?