6

Is it possible to stream the output of a program that is being executed via ssh?

Example program (test.py on remote):

import time
while True:
    print time.time()
    time.sleep(1)

Command (local):

ssh name@remote 'python test.py'

Since the program never terminates, the output is not streamed; is this possible in some way?

0

1 Answer 1

9

Apparently, adding the -t option to the ssh command works. It flushes the stdout:

ssh -t name@remote 'python test.py'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.