Sunday, April 19, 2009


I finally found out how to get ssh "$HOST" screen to work! The secret is shown by this convenient Python script that launches an SSH session to a remote host and starts screen:

from subprocess import Popen
from sys import argv, exit, stderr

if len(argv) >= 2:
options = argv[1:-1]
host = argv[-1]
Popen(['ssh', '-t'] + options + [host, 'screen']).communicate()
print >>stderr, 'Usage: %s [ options ] host' % argv[0]

Python really is a "clean" language.

Post a Comment