PDA

View Full Version : system("") issue. I need to use a "" in the ""



GunDeck
3rd August 2012, 19:32
Here is my problem.
Im OK at bash scripting:

I want to use QT to hide the scripting.
I want to run a bash script mysql -uuser -ppass dbname -e " what ever my script is "
so it comes out like system("mysql -uuser -ppass dbname -e " what ever my script is ";");

Double quoting seems to throw QT for a loop.
Is there a work around for this?
I would just like to use a bash call and be done with it since I know very little QT C++ scripting, but trying to learn.

Not looking forward to using a sql connection inside the db since I have to:
system("NUMBER=$(tac file | grep -Eo "item I dont want" -m 1 | sed 's/item I dont want/ /')")

And use that as a parameter in the mysql script

amleto
3rd August 2012, 22:23
QT is quicktime.

Qt is Qt.


in c++, strings can contain " easily, e.g.


char* example = "this is an \"example\"";