I am creating a control panel for minecraft and need to find a way to send commands to a screen session. I can run a shell script from php’s system() command. But when I do:
screen -S minecraft -X stuff “stop”
and switch to my sceen session, it shows stop written but it is as if enter was not pressed after enterin the command
So, how do I simulate enter in shell?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Try adding <code>\n</code> which stands for “new line” after <code>stop</code> (inside the quotation marks). Does that work?
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.