Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QProcess command entering problem.
Forum Updated to NodeBB v4.3 + New Features

QProcess command entering problem.

Scheduled Pinned Locked Moved Solved General and Desktop
qprocessnew line
3 Posts 2 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Priyank_
    wrote on 8 Mar 2016, 08:21 last edited by
    #1

    Being a noob, I want to know how can i solve this-

    my code-
    " QProcess sh;
    sh.start("sh");
    sh.write("cd ~/Documents/Mulstem_v1_0/GF");
    sh.write("gf");
    sh.write("i Aap.gf AapmPun.gf AapsPun.gf AapiPun.gf");
    sh.write("l Pred one (Compl two three) | wf -file=Pun.txt");
    sh.closeWriteChannel();
    sh.waitForFinished();
    sh.close(); "

    Desired result -
    "
    :~$ cd ~/Documents/Mulstem_v1_0/GF
    :~/Documents/Mulstem_v1_0/GF$ gf

    This is GF version 3.7.1.
    No recorded changes since RELEASE-3.7.1
    Built on linux/i386 with ghc-7.6, flags: interrupt server c-runtime
    License: see help -license.

    Languages:
    -> i Aap.gf AapmPun.gf AapsPun.gf AapiPun.gf
    linking ... OK

    Languages: AapiPun AapmPun AapsPun
    8 msec
    Aap> l Pred one (Compl two three) | wf -file=Pun.txt
    0 msec
    "

    while what i get is-
    "
    :~$ cd ~/Documents/Mulstem_v1_0/GF
    :~/Documents/Mulstem_v1_0/GF$ gf

    This is GF version 3.7.1.
    No recorded changes since RELEASE-3.7.1
    Built on linux/i386 with ghc-7.6, flags: interrupt server c-runtime
    License: see help -license.

    Languages:
    -> i Aap.gf AapmPun.gf AapsPun.gf AapiPun.gf
    "

    ~It waits after the " i Aap.gf AapmPun.gf AapsPun.gf AapiPun.gf" command.. where it should take a enter and the next command.

    Is it because terminal state is in interrupt mode? If so, how can i enter commands in that mode?
    Help?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 8 Mar 2016, 21:49 last edited by
      #2

      Hi,

      Why not put that in a shell script and call that script with QProcess ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      P 1 Reply Last reply 11 Mar 2016, 04:30
      1
      • S SGaist
        8 Mar 2016, 21:49

        Hi,

        Why not put that in a shell script and call that script with QProcess ?

        P Offline
        P Offline
        Priyank_
        wrote on 11 Mar 2016, 04:30 last edited by
        #3

        @SGaist Thanks, it helped!

        1 Reply Last reply
        0

        2/3

        8 Mar 2016, 21:49

        • Login

        • Login or register to search.
        2 out of 3
        • First post
          2/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved