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;
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
add a comment
|
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
add a comment
|
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
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
command-line bash gnu-screen
asked May 30 at 11:45
BestMordaEverBestMordaEver
163 bronze badges
163 bronze badges
add a comment
|
add a comment
|
1 Answer
1
active
oldest
votes
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
add a comment
|
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
add a comment
|
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
add a comment
|
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
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
edited May 30 at 13:02
answered May 30 at 12:47
BestMordaEverBestMordaEver
163 bronze badges
163 bronze badges
add a comment
|
add a comment
|
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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