Results 1 to 2 of 2

Thread: system("") issue. I need to use a "" in the ""

  1. #1

    Default system("") issue. I need to use a "" in the ""

    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

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: system("") issue. I need to use a "" in the ""

    QT is quicktime.

    Qt is Qt.


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

    Qt Code:
    1. char* example = "this is an \"example\"";
    To copy to clipboard, switch view to plain text mode 
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. Replies: 1
    Last Post: 7th April 2010, 21:46
  2. Replies: 3
    Last Post: 15th February 2010, 17:27
  3. Replies: 3
    Last Post: 8th July 2008, 19:37
  4. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05
  5. QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
    By fengtian.we in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2007, 15:58

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.