I am used to using linux terminals and nohup over ssh to issue commands that run in the background even when logged out of the ssh session. For some reason nohup seems to be broken in the latest MACOS. For that reason I am trying to executing this small sample script using screen command.
sleep 10
echo "this is my test file" > testfile
This file is saved as tst script. And then I issue the following command.
ssh sohaib@localhost screen -dm sh testscript
However nothing happens. screen just exits quietly without writing to the file testfile. If I run this without ssh it works as desired. What am I doing wrong here?