I have a script and use the following command in it:
screen -dmS name bash -c "ls -1 > out"
What I am trying to achieve is to create a screen session, run a command and detach from it. The command above is working fine, except for the screen session which is being terminated:
screen -list No Sockets found in /var/run/screen/S-root.
Why the session is not saved despite on the