Weird behavior of QProcess and multiple qoutes
- 
@Guanhong said in Weird behavior of QProcess and multiple qoutes: < wpa_cli -i wlan0 set_network 1 ssid '"hima24g"' 
 I run it on an Ubuntu console, and it can run successfully@Guanhong said in Weird behavior of QProcess and multiple qoutes: wpa_cli -i wlan0 set_network 1 ssid '"hima24g"' wpa_cli -i wlan0 set_network 1 ssid hima24gshould work just as good 
- 
@Guanhong said in Weird behavior of QProcess and multiple qoutes: < wpa_cli -i wlan0 set_network 1 ssid '"hima24g"' 
 I run it on an Ubuntu console, and it can run successfullyset_network 1 is not "set_network" << "0" 
- 
wpa_cli -i wlan0 set_network 1 ssid hima24g 
 without quotes, it does not work on my console.set_network 1 or set_network 0 does not matter. 
 It depends.@Guanhong So, did you try to print out https://doc.qt.io/qt-5/qprocess.html#readAllStandardError ? 
- 
Looks like wpa_cli really needs additional double quotes... strange and weird program (see google for a lot of confusion due to this behavior). 
 So it must bearguments << "-i" << "wlan0" << "set_network" << "0"<< "ssid" << "\"" + strSSID + "\"";
- 
Looks like wpa_cli really needs additional double quotes... strange and weird program (see google for a lot of confusion due to this behavior). 
 So it must bearguments << "-i" << "wlan0" << "set_network" << "0"<< "ssid" << "\"" + strSSID + "\"";@Christian-Ehrlicher 
 this command includes not only double quotes but also single quotes outside. Can QProcess handle it?
- 
The outer quotes are only needed so the inner ones are not removed by the shell. 
- 
The outer quotes are only needed so the inner ones are not removed by the shell. @Christian-Ehrlicher 
 I don't think so. both quotes are necessary, without either, the command doesn't work on command line.
- 
@Christian-Ehrlicher 
 I don't think so. both quotes are necessary, without either, the command doesn't work on command line.@Guanhong 
 Do you understand that, certainly quote-wise, what you type into a shell/command-line is not the same as what you would put into theQStringListfor the arguments toQProcess::start()?Meanwhile if you helped us by using the forum's Code toolbutton around what you are entering on the command-line it would be a lot easier to read/understand. 
- 
@Christian-Ehrlicher 
 I don't think so. both quotes are necessary, without either, the command doesn't work on command line.@Guanhong said in Weird behavior of QProcess and multiple qoutes: I don't think so. both quotes are necessary, without either, the command doesn't work on command line. I'm giving up.... don't know how often I must explain that your shell/command line removes the outer quotes... 
- 
@Guanhong said in Weird behavior of QProcess and multiple qoutes: I don't think so. both quotes are necessary, without either, the command doesn't work on command line. I'm giving up.... don't know how often I must explain that your shell/command line removes the outer quotes... @Christian-Ehrlicher 
 thank you very much ,
 arguments << "-i" << "wlan0" << "set_network" << "0"<< "ssid" << """ + strSSID + """;
 works.sorry for my poor understanding. 
 


