Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Executable from sh file
Forum Updated to NodeBB v4.3 + New Features

Executable from sh file

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
10 Posts 3 Posters 745 Views 2 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.
  • J Offline
    J Offline
    JacobNovitsky
    wrote on 21 Sept 2024, 12:13 last edited by
    #1

    I have sh file which opened by Qt Creator as executable
    is it possible to change this setting from terminal, not manually changing setting for each project

    sh file
    gnome-terminal --geometry=80x24+100+100 -- bash -c "/home/j/M-Debug/M; exec bash"

    to execute this I usually go Run
    executable:.sh file
    dir - /home/j/M-Debug/M
    I need to be able to do this for each App from terminal

    1 Reply Last reply
    0
    • C Christian Ehrlicher moved this topic from General and Desktop on 21 Sept 2024, 14:16
    • A Offline
      A Offline
      Axel Spoerl
      Moderators
      wrote on 21 Sept 2024, 19:35 last edited by
      #2

      When you post code, please use the </> code formatting tags to make it easier to read for everybody.
      Furthermore, after reading your post 3 times, I dont understand

      • the headline: What is an "Executable from sh file" ?
      • the question: What do you mean by "for each App from terminal" ?

      Software Engineer
      The Qt Company, Oslo

      J 1 Reply Last reply 21 Sept 2024, 20:54
      0
      • A Axel Spoerl
        21 Sept 2024, 19:35

        When you post code, please use the </> code formatting tags to make it easier to read for everybody.
        Furthermore, after reading your post 3 times, I dont understand

        • the headline: What is an "Executable from sh file" ?
        • the question: What do you mean by "for each App from terminal" ?
        J Offline
        J Offline
        JacobNovitsky
        wrote on 21 Sept 2024, 20:54 last edited by
        #3

        @Axel-Spoerl oh, my apologies, when I see request to put code to code tags, I understand it literally and never recognize terminal command as code.
        Next time, if not forget, gonna put it to <> as you requested

        I meant this qt.png

        1 Reply Last reply
        0
        • A Offline
          A Offline
          Axel Spoerl
          Moderators
          wrote on 21 Sept 2024, 20:59 last edited by
          #4

          Thanks.
          What is it that you actually want to do? Run your application in a terminal from Qt Creator?
          In that case, clicking the "Run in terminal" checkbox is enough.
          Otherwise: what is open_terminal.sh? Please post the content.

          Software Engineer
          The Qt Company, Oslo

          J 1 Reply Last reply 21 Sept 2024, 21:29
          0
          • A Axel Spoerl
            21 Sept 2024, 20:59

            Thanks.
            What is it that you actually want to do? Run your application in a terminal from Qt Creator?
            In that case, clicking the "Run in terminal" checkbox is enough.
            Otherwise: what is open_terminal.sh? Please post the content.

            J Offline
            J Offline
            JacobNovitsky
            wrote on 21 Sept 2024, 21:29 last edited by
            #5

            @Axel-Spoerl
            I want to open terminal called by Qt Creator on predefined xy and wh

            gnome-terminal --geometry=80x24+100+100 -- bash -c "/home/j/M-Debug/M; exec bash"
            
            J 1 Reply Last reply 22 Sept 2024, 08:40
            0
            • J JacobNovitsky
              21 Sept 2024, 21:29

              @Axel-Spoerl
              I want to open terminal called by Qt Creator on predefined xy and wh

              gnome-terminal --geometry=80x24+100+100 -- bash -c "/home/j/M-Debug/M; exec bash"
              
              J Online
              J Online
              JonB
              wrote on 22 Sept 2024, 08:40 last edited by JonB
              #6

              @JacobNovitsky
              And what happens if that is what you have in your open_terminal.sh as you show it?

              I don't understand your bash -c "/home/j/M-Debug/M; exec bash" part? What is it supposed to do and does what you have really work?

              /home/j/M-Debug/M: is this really some executable? If not this is not a legal shell command.

              exec bash: what are you trying to do here? Creator is supposed presumably to use this to create a terminal in which you can run the actual executable your project is producing. I can only guess it puts your executable at the end of this command, perhaps preceded by some option or perhaps you are supposed to put that in or deal with it yourself. I am not convinced your script is dealing with that correctly. Find out what exact command Creator produces with your script and your executable. If you can't find that write a one-line script to use as your command which simply prints/sends to file precisely how it is being invoked (all command-line arguments) so then you will know.

              J 1 Reply Last reply 22 Sept 2024, 10:55
              0
              • J JonB
                22 Sept 2024, 08:40

                @JacobNovitsky
                And what happens if that is what you have in your open_terminal.sh as you show it?

                I don't understand your bash -c "/home/j/M-Debug/M; exec bash" part? What is it supposed to do and does what you have really work?

                /home/j/M-Debug/M: is this really some executable? If not this is not a legal shell command.

                exec bash: what are you trying to do here? Creator is supposed presumably to use this to create a terminal in which you can run the actual executable your project is producing. I can only guess it puts your executable at the end of this command, perhaps preceded by some option or perhaps you are supposed to put that in or deal with it yourself. I am not convinced your script is dealing with that correctly. Find out what exact command Creator produces with your script and your executable. If you can't find that write a one-line script to use as your command which simply prints/sends to file precisely how it is being invoked (all command-line arguments) so then you will know.

                J Offline
                J Offline
                JacobNovitsky
                wrote on 22 Sept 2024, 10:55 last edited by JacobNovitsky
                #7

                @JonB it opens my app with Qt Terminal in predefined xy wh
                It works well, but I want to be able to change this setting not manually in Qt Creator settings, but in automated way
                cheers

                this is pass to .o files and app executable itself, files made by Qt Creator
                build directory
                /home/j/M-Debug/M
                where M is AppName

                J J 2 Replies Last reply 22 Sept 2024, 10:57
                0
                • J JacobNovitsky
                  22 Sept 2024, 10:55

                  @JonB it opens my app with Qt Terminal in predefined xy wh
                  It works well, but I want to be able to change this setting not manually in Qt Creator settings, but in automated way
                  cheers

                  this is pass to .o files and app executable itself, files made by Qt Creator
                  build directory
                  /home/j/M-Debug/M
                  where M is AppName

                  J Online
                  J Online
                  JonB
                  wrote on 22 Sept 2024, 10:57 last edited by
                  #8

                  @JacobNovitsky said in Executable from sh file:

                  but I want to be able to change this setting not manually but in automated way

                  I do not know what that means/what you have in mind.

                  1 Reply Last reply
                  0
                  • J JacobNovitsky
                    22 Sept 2024, 10:55

                    @JonB it opens my app with Qt Terminal in predefined xy wh
                    It works well, but I want to be able to change this setting not manually in Qt Creator settings, but in automated way
                    cheers

                    this is pass to .o files and app executable itself, files made by Qt Creator
                    build directory
                    /home/j/M-Debug/M
                    where M is AppName

                    J Offline
                    J Offline
                    JacobNovitsky
                    wrote on 22 Sept 2024, 10:59 last edited by
                    #9

                    @JacobNovitsky
                    in terminal: qtcreator appName setExecutable -> path to open_terminal.sh

                    J 1 Reply Last reply 22 Sept 2024, 11:04
                    0
                    • J JacobNovitsky
                      22 Sept 2024, 10:59

                      @JacobNovitsky
                      in terminal: qtcreator appName setExecutable -> path to open_terminal.sh

                      J Online
                      J Online
                      JonB
                      wrote on 22 Sept 2024, 11:04 last edited by
                      #10

                      @JacobNovitsky
                      I think you are saying you want to pass the name/path of your current executable as a Command line argument to the script (and change the script to pick that up from its command line arguments). And you probably would like that name/path to come from a "variable" which Creator has set up for you when you configure your project.

                      I don't know how you do that in this place to get it from a "Creator variable". I see the Command line arguments has a drop-down to the right. What does that offer you?

                      1 Reply Last reply
                      0

                      1/10

                      21 Sept 2024, 12:13

                      • Login

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