QProcess is not running for some programs in linux..
-
Hello ,
i'm using the following snippet and it doesn't work.. Does someone experience the same issue ? the
rm
command works as expected.. Alsoprocess.errorString()
returns "unknown error"QProcess process; const QString sed = "/usr/bin/sed" ; const QString ed = "'s/"+esc_username+":.*$//'"; const Qstring option = "-i"; const QString shadowpath = "/etc/shadow"; QStringList arguments ; arguments << option << ed << shadowpath ; process.start(sed, arguments); process.waitForStarted(); process.waitForFinished(); arguments.clear();
-
Hello ,
i'm using the following snippet and it doesn't work.. Does someone experience the same issue ? the
rm
command works as expected.. Alsoprocess.errorString()
returns "unknown error"QProcess process; const QString sed = "/usr/bin/sed" ; const QString ed = "'s/"+esc_username+":.*$//'"; const Qstring option = "-i"; const QString shadowpath = "/etc/shadow"; QStringList arguments ; arguments << option << ed << shadowpath ; process.start(sed, arguments); process.waitForStarted(); process.waitForFinished(); arguments.clear();
-
@xenovas said in QProcess is not running for some programs in linux..:
const QString ed = "'s/"+esc_username+":.*$//'";
The single quotes are wrong
-
@xenovas said in QProcess is not running for some programs in linux..:
const QString ed = "'s/"+esc_username+":.*$//'";
The single quotes are wrong
The single quotes are wrong
Indeed. It might help the OP if you commented that they should not be there at all! :)
-
Hi,
Unless you run it as root, it won't work because the file you are trying to modify is not accessible to standard users.
-
Hi,
Unless you run it as root, it won't work because the file you are trying to modify is not accessible to standard users.