Directing input made to a screen session with a command to a specific window inside the session?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












So I have an automatic backup script hourly backing up important files of the server.



It has many lines like this that send input to the screen session the game server console is running in to broadcast when it starts to backup the files:



screen -x $SCREENNAME -X stuff "`printf "say Backing up world: '$WORLD'r"`


It works fine, unless I'm using a different window inside of the screen session.



When I'm using a different window in the same screen session the script tries to execute the say Backing up world in the bash terminal I'm using which doesn't work and no message gets sent to the game console.



Is there any way to direct the output to a specific screen inside the seesion. My game console is always on the first screen so screen 0.



I'm on CentOS 7 if that's relevant







share|improve this question
























    up vote
    2
    down vote

    favorite












    So I have an automatic backup script hourly backing up important files of the server.



    It has many lines like this that send input to the screen session the game server console is running in to broadcast when it starts to backup the files:



    screen -x $SCREENNAME -X stuff "`printf "say Backing up world: '$WORLD'r"`


    It works fine, unless I'm using a different window inside of the screen session.



    When I'm using a different window in the same screen session the script tries to execute the say Backing up world in the bash terminal I'm using which doesn't work and no message gets sent to the game console.



    Is there any way to direct the output to a specific screen inside the seesion. My game console is always on the first screen so screen 0.



    I'm on CentOS 7 if that's relevant







    share|improve this question






















      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      So I have an automatic backup script hourly backing up important files of the server.



      It has many lines like this that send input to the screen session the game server console is running in to broadcast when it starts to backup the files:



      screen -x $SCREENNAME -X stuff "`printf "say Backing up world: '$WORLD'r"`


      It works fine, unless I'm using a different window inside of the screen session.



      When I'm using a different window in the same screen session the script tries to execute the say Backing up world in the bash terminal I'm using which doesn't work and no message gets sent to the game console.



      Is there any way to direct the output to a specific screen inside the seesion. My game console is always on the first screen so screen 0.



      I'm on CentOS 7 if that's relevant







      share|improve this question












      So I have an automatic backup script hourly backing up important files of the server.



      It has many lines like this that send input to the screen session the game server console is running in to broadcast when it starts to backup the files:



      screen -x $SCREENNAME -X stuff "`printf "say Backing up world: '$WORLD'r"`


      It works fine, unless I'm using a different window inside of the screen session.



      When I'm using a different window in the same screen session the script tries to execute the say Backing up world in the bash terminal I'm using which doesn't work and no message gets sent to the game console.



      Is there any way to direct the output to a specific screen inside the seesion. My game console is always on the first screen so screen 0.



      I'm on CentOS 7 if that's relevant









      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 1 at 15:29









      Tundral

      425




      425




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          You can preselect a window by specifying -p , 0 is first window, 1 is second so on...



          screen -x $SCREENNAME -p 0 -X stuff "printf "say Backing up world: '$WORLD'r""






          share|improve this answer




















          • So my screen now has this in it screen -p 0 -S $SCREENNAME -X eval 'stuff "helpop $SAY_BACKUP_START"15' But it still keeps inputting the things to the window that I have currently selected instead of window #0
            – Tundral
            Apr 28 at 11:55











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          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',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f434851%2fdirecting-input-made-to-a-screen-session-with-a-command-to-a-specific-window-ins%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted










          You can preselect a window by specifying -p , 0 is first window, 1 is second so on...



          screen -x $SCREENNAME -p 0 -X stuff "printf "say Backing up world: '$WORLD'r""






          share|improve this answer




















          • So my screen now has this in it screen -p 0 -S $SCREENNAME -X eval 'stuff "helpop $SAY_BACKUP_START"15' But it still keeps inputting the things to the window that I have currently selected instead of window #0
            – Tundral
            Apr 28 at 11:55















          up vote
          1
          down vote



          accepted










          You can preselect a window by specifying -p , 0 is first window, 1 is second so on...



          screen -x $SCREENNAME -p 0 -X stuff "printf "say Backing up world: '$WORLD'r""






          share|improve this answer




















          • So my screen now has this in it screen -p 0 -S $SCREENNAME -X eval 'stuff "helpop $SAY_BACKUP_START"15' But it still keeps inputting the things to the window that I have currently selected instead of window #0
            – Tundral
            Apr 28 at 11:55













          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          You can preselect a window by specifying -p , 0 is first window, 1 is second so on...



          screen -x $SCREENNAME -p 0 -X stuff "printf "say Backing up world: '$WORLD'r""






          share|improve this answer












          You can preselect a window by specifying -p , 0 is first window, 1 is second so on...



          screen -x $SCREENNAME -p 0 -X stuff "printf "say Backing up world: '$WORLD'r""







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 1 at 16:46









          Bharat

          3058




          3058











          • So my screen now has this in it screen -p 0 -S $SCREENNAME -X eval 'stuff "helpop $SAY_BACKUP_START"15' But it still keeps inputting the things to the window that I have currently selected instead of window #0
            – Tundral
            Apr 28 at 11:55

















          • So my screen now has this in it screen -p 0 -S $SCREENNAME -X eval 'stuff "helpop $SAY_BACKUP_START"15' But it still keeps inputting the things to the window that I have currently selected instead of window #0
            – Tundral
            Apr 28 at 11:55
















          So my screen now has this in it screen -p 0 -S $SCREENNAME -X eval 'stuff "helpop $SAY_BACKUP_START"15' But it still keeps inputting the things to the window that I have currently selected instead of window #0
          – Tundral
          Apr 28 at 11:55





          So my screen now has this in it screen -p 0 -S $SCREENNAME -X eval 'stuff "helpop $SAY_BACKUP_START"15' But it still keeps inputting the things to the window that I have currently selected instead of window #0
          – Tundral
          Apr 28 at 11:55













           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f434851%2fdirecting-input-made-to-a-screen-session-with-a-command-to-a-specific-window-ins%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?