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.

link|improve this question
feedback

migrated from stackoverflow.com Mar 30 '10 at 8:14

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

2 Answers

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.

link|improve this answer
feedback

Why not just do:

screen -S test ./test.php
link|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
feedback

Your Answer

 
or
required, but never shown