Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to start screen with some bash command to execute. I'm trying:

screen -S test -d -m bash -c './test.php'

but have no result, screen didn't apear.

Even more, let's say I need to start something like this:

vlc -I ncurses --http-reconnect http://ip/ --sout '#duplicate{dst=std{access=http{user=,pwd=},mux=ts,dst=:51001}}' --ttl=255 --loop --repeat

How do I do this? I'd like the screen to continue to display the results if the command completes.

share|improve this question

migrated from Mar 30 '10 at 8:14

This question came from our site for professional and enthusiast programmers.

You're starting screen with -d -m. From the manpage:

-d -m Start screen in "detached" mode. This creates a new session but doesn’t attach to it. This is useful for system startup scripts.

screen -r should attach your screen with the running command.

share|improve this answer

Why not just do:

screen -S test ./test.php
share|improve this answer
[screen is terminating] that's all that i get – Jeje Mar 29 '10 at 10:43
that means the script finished executing. do you want the screen to remain open after the script has finished executing? – reko_t Mar 29 '10 at 10:46
sure, screen must be alive after script executed – Jeje Mar 29 '10 at 11:51

You must log in to answer this question.