What does screen -dmS task1 ./script1.sh do?
screen -dmS task1 ./script1.sh
Terminates a session named task1.
task1
Lists all existing Screen sessions without starting a script.
Runs the script only in the current foreground terminal.
Creates a named Screen session, starts the script in it, and leaves the session detached.