Is there a way to send commands to screened process?Bash script to start 'motion' on screen lockSimple bash script does not want to start at rebootHow to run commands from a bash file the way they run from terminal?Stuck in a loop after login in 14.04How can I start GNU Screen automatically when I open a new terminal window?Running command in a new bash shell processAttach, Detach and Kill a process in Screen with a bash scriptHow do I start and stop a systemctl service inside a bash script?

How to deal with non-stop callers in the service desk

Is the ''yoi'' meaning ''ready'' when doing karate the same as the ''yoi'' which means nice/good?

How to inflict ESD-damage on a board?

What does exhaust smell on oil and transmission dipstick mean?

Why is more music written in sharp keys than flat keys?

Why do some switching regulator require tantalum or electrolytic capacitors instead of ceramic?

Why are so many cities in the list of 50 most violent cities in the world located in South and Central America?

Why does Bane's stock exchange robbery actually work to bankrupt Bruce Wayne?

Antonym for “boilerplate” or “cookie-cutter”

What's a good strategy for offering low on a house?

Equivalent of phrase 'emu parade' in other English-speaking places

Why does the Joker do this to Bob?

Would the professor leave the classroom if only 1 student uses their cellphone during class?

Artificially isolated pawn in the Caro-Kann

What happens to extra attacks after you kill your declared target

Why don't we say a blessing before giving charity?

How can I filter an EntityClass by _not_ having a property?

Why would an elected (absentionist) Sinn Féin MP resign from the House of Commons?

Protecting Seals from Forgery

Substantivization of "continuum"

When to use 8va in musical notation?

How do I figure out how many hydrogens my compound actually has using a mass and NMR spectrum?

Is it possible to commute 34 km (21 miles) daily?

How short does a trip need to be before flying is less safe than other forms of transportation?



Is there a way to send commands to screened process?


Bash script to start 'motion' on screen lockSimple bash script does not want to start at rebootHow to run commands from a bash file the way they run from terminal?Stuck in a loop after login in 14.04How can I start GNU Screen automatically when I open a new terminal window?Running command in a new bash shell processAttach, Detach and Kill a process in Screen with a bash scriptHow do I start and stop a systemctl service inside a bash script?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









1

















I have a process, that automatically starts up with server using this command -



screen -dmSL myserver sudo bash /myserver/start


I can stop the process if I connect to the screen with screen -x myserver and enter stop command.



Now, say I have a script /myserver/stop, how would it work? It won't work with following contents:



screen -x myserver
stop









share|improve this question
































    1

















    I have a process, that automatically starts up with server using this command -



    screen -dmSL myserver sudo bash /myserver/start


    I can stop the process if I connect to the screen with screen -x myserver and enter stop command.



    Now, say I have a script /myserver/stop, how would it work? It won't work with following contents:



    screen -x myserver
    stop









    share|improve this question




























      1












      1








      1








      I have a process, that automatically starts up with server using this command -



      screen -dmSL myserver sudo bash /myserver/start


      I can stop the process if I connect to the screen with screen -x myserver and enter stop command.



      Now, say I have a script /myserver/stop, how would it work? It won't work with following contents:



      screen -x myserver
      stop









      share|improve this question















      I have a process, that automatically starts up with server using this command -



      screen -dmSL myserver sudo bash /myserver/start


      I can stop the process if I connect to the screen with screen -x myserver and enter stop command.



      Now, say I have a script /myserver/stop, how would it work? It won't work with following contents:



      screen -x myserver
      stop






      command-line bash gnu-screen






      share|improve this question














      share|improve this question











      share|improve this question




      share|improve this question










      asked May 30 at 11:45









      BestMordaEverBestMordaEver

      163 bronze badges




      163 bronze badges























          1 Answer
          1






          active

          oldest

          votes


















          1


















          After a bit of experimenting here's the answer I found. This is the command that I will use:



          screen -p 0 -S myserver -X eval "stuff stop15"


          Now point by point:



          -S says to connect to screen session myserver



          -p specifies that message goes to window 0 in seession



          -X is argument that allows you to send commands to screen session without entering it yourself



          eval tells to print "stop" and a newline to the application's stdin






          share|improve this answer





























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "89"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );














            draft saved

            draft discarded
















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1147394%2fis-there-a-way-to-send-commands-to-screened-process%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown


























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1


















            After a bit of experimenting here's the answer I found. This is the command that I will use:



            screen -p 0 -S myserver -X eval "stuff stop15"


            Now point by point:



            -S says to connect to screen session myserver



            -p specifies that message goes to window 0 in seession



            -X is argument that allows you to send commands to screen session without entering it yourself



            eval tells to print "stop" and a newline to the application's stdin






            share|improve this answer
































              1


















              After a bit of experimenting here's the answer I found. This is the command that I will use:



              screen -p 0 -S myserver -X eval "stuff stop15"


              Now point by point:



              -S says to connect to screen session myserver



              -p specifies that message goes to window 0 in seession



              -X is argument that allows you to send commands to screen session without entering it yourself



              eval tells to print "stop" and a newline to the application's stdin






              share|improve this answer






























                1














                1










                1









                After a bit of experimenting here's the answer I found. This is the command that I will use:



                screen -p 0 -S myserver -X eval "stuff stop15"


                Now point by point:



                -S says to connect to screen session myserver



                -p specifies that message goes to window 0 in seession



                -X is argument that allows you to send commands to screen session without entering it yourself



                eval tells to print "stop" and a newline to the application's stdin






                share|improve this answer
















                After a bit of experimenting here's the answer I found. This is the command that I will use:



                screen -p 0 -S myserver -X eval "stuff stop15"


                Now point by point:



                -S says to connect to screen session myserver



                -p specifies that message goes to window 0 in seession



                -X is argument that allows you to send commands to screen session without entering it yourself



                eval tells to print "stop" and a newline to the application's stdin







                share|improve this answer















                share|improve this answer




                share|improve this answer








                edited May 30 at 13:02

























                answered May 30 at 12:47









                BestMordaEverBestMordaEver

                163 bronze badges




                163 bronze badges































                    draft saved

                    draft discarded















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1147394%2fis-there-a-way-to-send-commands-to-screened-process%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown









                    Popular posts from this blog

                    Tamil (spriik) Luke uk diar | Nawigatjuun

                    Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

                    Where does the image of a data connector as a sharp metal spike originate from?Where does the concept of infected people turning into zombies only after death originate from?Where does the motif of a reanimated human head originate?Where did the notion that Dragons could speak originate?Where does the archetypal image of the 'Grey' alien come from?Where did the suffix '-Man' originate?Where does the notion of being injured or killed by an illusion originate?Where did the term “sophont” originate?Where does the trope of magic spells being driven by advanced technology originate from?Where did the term “the living impaired” originate?