Need a suggestion. I execute remote ssh commands by passing arguments to ssh. Now I do that by firing everything inside a detached screen session. The problem is the screen session terminates as soon as the commands execute off.
Example: screen -dmS test_screen ssh root@somebox.com
The above creates a detached screen named test_screen & inside that it would have sshed into root@somebox.com.
But when I pass commands to ssh , like 'ls -l /tmp' on the remote box, after the commands successfully executes the screen session terminates & I am not able to see the output. Basically I don't want the screen session to terminate after doing this:
Example: screen -dmS ssh root@somebox 'ls -l /tmp'
Any help?