# How to execute a command in screen and detach

command linegnu-screenscript

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.

screen -d -m yourcommand