How can I get screen to execute a command and then detach (That is, automatically in a single script without further input beyond initially starting the script)? e.g. I run myscript.sh and it automatically starts a screen session, executes a command, then detaches.
Tell me more
×
Super User is a question and answer site for
computer enthusiasts and power users. It's 100% free, no registration required.
|
This is an easy one:
|
|||||||||
|
|
Run the command, follow it by screen command like:
Then press Ctrl+A (release) and then D to detach the process. To resume detached process, use:
To list your sessions, try:
|
|||||
|
|
|||||
|