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. Can i put a bash scripts into Qt based application for Linux?
Forum Updated to NodeBB v4.3 + New Features

Can i put a bash scripts into Qt based application for Linux?

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 787 Views
  • 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.
  • Y Offline
    Y Offline
    YtreioJ
    wrote on last edited by
    #1

    Hi,
    ex, i'm newbie in the Qt, can i put some short bash scripts to my qt app on linux as an exec? Or how to simply re-write it into qt code?
    Scripts for service overload, for copying, etc
    .
    Maybe you have some manuals about it?

    ODБOïO 1 Reply Last reply
    0
    • Y YtreioJ

      Hi,
      ex, i'm newbie in the Qt, can i put some short bash scripts to my qt app on linux as an exec? Or how to simply re-write it into qt code?
      Scripts for service overload, for copying, etc
      .
      Maybe you have some manuals about it?

      ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by
      #2

      @YtreioJ Hi,
      You can use QProcess to start external process

      1 Reply Last reply
      2
      • Y Offline
        Y Offline
        YtreioJ
        wrote on last edited by
        #3

        It's just run a script with the terminal window? Can i hide the terminal window with these methods?

        JonBJ 1 Reply Last reply
        0
        • Y YtreioJ

          It's just run a script with the terminal window? Can i hide the terminal window with these methods?

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @YtreioJ
          A script run as a QProcess will not show any terminal window.

          Y 1 Reply Last reply
          2
          • JonBJ JonB

            @YtreioJ
            A script run as a QProcess will not show any terminal window.

            Y Offline
            Y Offline
            YtreioJ
            wrote on last edited by
            #5

            @JonB said in Can i put a bash scripts into Qt based application for Linux?:

            @YtreioJ
            A script run as a QProcess will not show any terminal window.

            But sudo-password is require for my script

            JonBJ 1 Reply Last reply
            0
            • Y YtreioJ

              @JonB said in Can i put a bash scripts into Qt based application for Linux?:

              @YtreioJ
              A script run as a QProcess will not show any terminal window.

              But sudo-password is require for my script

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by JonB
              #6

              @YtreioJ
              That does not affect the fact that QProcess will not show any terminal window. And so left to its own devices is not suitable to just run sudo ... if you want interactive password prompting.

              For that you might either examine using sudo -S, or sudo -A and the SUDO_ASKPASS environment variable, or policy kits, or... https://unix.stackexchange.com/questions/254072/how-do-i-ask-password-by-gui-prompt-while-using-sudo-in-script covers some of the possibilities, https://www.linuxquestions.org/questions/programming-9/problem-in-launching-a-terminal-command-with-a-qt-button-787946/, others. I also posted on this matter in this forum previously at https://forum.qt.io/topic/100215/linux-run-external-process-with-requesting-password

              Y 1 Reply Last reply
              3
              • JonBJ JonB

                @YtreioJ
                That does not affect the fact that QProcess will not show any terminal window. And so left to its own devices is not suitable to just run sudo ... if you want interactive password prompting.

                For that you might either examine using sudo -S, or sudo -A and the SUDO_ASKPASS environment variable, or policy kits, or... https://unix.stackexchange.com/questions/254072/how-do-i-ask-password-by-gui-prompt-while-using-sudo-in-script covers some of the possibilities, https://www.linuxquestions.org/questions/programming-9/problem-in-launching-a-terminal-command-with-a-qt-button-787946/, others. I also posted on this matter in this forum previously at https://forum.qt.io/topic/100215/linux-run-external-process-with-requesting-password

                Y Offline
                Y Offline
                YtreioJ
                wrote on last edited by
                #7

                @JonB Oh, thank you!

                1 Reply Last reply
                0

                • Login

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