To pass a value as response to linux command using QT
Hi all,
I am designing an application using QT for an embedded device and I got stuck in an issue. I can able to pass the linux command using system() function. For a particular command I need to enter the password dynamically in the application window. Please help me to send the value for the previous executed command, dynamically using QT application.
Thanks in advance....
Re: To pass a value as response to linux command using QT
I am not sure what you mean, but if you need more control over the external command, have a look at QProcess instead of system()
Cheers,
_
Re: To pass a value as response to linux command using QT
I think what chillin means is something like:
A command like this will ask for a password ...
Re: To pass a value as response to linux command using QT
yes graciano you are correct.
I will explain the issue bit clearly.
I am developing an application in which I will run some commands using system() function, which may request password for commands with "sudo" and "ssh", in that case I need to pass the password as a string to response the command which will be waiting to get the password as input. I need help (with example code) to pass the password to the commands which are executed using the system() function.
Re: To pass a value as response to linux command using QT
Well, if you insist on using the system function, then you are out of luck.
Cheers,
_
Re: To pass a value as response to linux command using QT
I'm using linux and there's a reason about asking for a password...I read about echoing:
echo -e "tadaaa" | sudo -S format all
but, I prefer the asking annoy
Re: To pass a value as response to linux command using QT
Please let me know (with scratch code) if any other function other than system() performs the same task.
Thank you in advance.
Re: To pass a value as response to linux command using QT
I suggest reading the replies then.
Comment #2 might be a good start.
Cheers,
_