Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.
screen -dmS test_screen echo 'test'

Why does the screen "test_screen" exit as soon as it's "finished"? When I start a screen and then detach it manually (screen -S test_screen, then Ctrl+a d), the screen will keep existing until I exit manually. What's the difference?

SOLUTION:

Solution: start the screen first without any command:

screen -dmS screen_name

then you can run commands like this:

screen -S screen_name -p 0 -X stuff $'echo hello world\n'
share|improve this question

migrated from stackoverflow.com Feb 25 at 11:07

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.