How to set ip address to a computer in Qt (Solved)
-
cat passwd.txt return my password correct
-
cat passwd.txt return my password correct
-
it works when i do a sudo su
it doesn't work without permission, what should i do next? -
it works when i do a sudo su
it doesn't work without permission, what should i do next? -
It does work for me from the App and Outside
@
args<<"-c"<<
"sudo -S ifconfig eth0 192.168.100.21</home/ubuntu/passwd.txt";
@There should be a space before and after < in above command.
-
It does work for me from the App and Outside
@
args<<"-c"<<
"sudo -S ifconfig eth0 192.168.100.21</home/ubuntu/passwd.txt";
@There should be a space before and after < in above command.
-
under /opt
cat >password.txt 'Key in my password'
cat password 'Check my password'its work, thanks alot :>>
-
under /opt
cat >password.txt 'Key in my password'
cat password 'Check my password'its work, thanks alot :>>
-
Well then get the errors using readyReadStandardError() signal if any.
-
Well then get the errors using readyReadStandardError() signal if any.
-
what does "-c" in front of "sudo -s" meant or used for??
-
what does "-c" in front of "sudo -s" meant or used for??
-
It is for sh so that it reads commands from argument strings. Check "this":http://manpages.ubuntu.com/manpages/utopic/en/man1/sh.1posix.html man page for more details. I hope your system has sh command.
-
It is for sh so that it reads commands from argument strings. Check "this":http://manpages.ubuntu.com/manpages/utopic/en/man1/sh.1posix.html man page for more details. I hope your system has sh command.
-
QProcess Class is used to start external programs and to communicate with them.
create a new QProcess and input args to /bin/sh.
Below code has been tested working.
Thanks to p3c0, if not, answer below will not be available :QProcess *myProcess = new QProcess; QStringList args; args<"-c"<<"sudo -S ifconfig eth0 192.168.100.1 < /var/passwd.txt"); myProcess->start("/bin/sh",args);