Start screen with bash command

6,288

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:
6,288

Related videos on Youtube

quack quixote
Author by

quack quixote

Updated on September 17, 2022

Comments

  • quack quixote
    quack quixote over 1 year

    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.

  • Admin
    Admin about 14 years
    [screen is terminating] that's all that i get
  • Admin
    Admin about 14 years
    that means the script finished executing. do you want the screen to remain open after the script has finished executing?
  • Admin
    Admin about 14 years
    sure, screen must be alive after script executed