piping data through ssh

not that what i’m about to tell you is brilliant, new or revolutionary, however i thought i’d mention it in case you’re not doing it. also feel free to let me know if there is a better way.

problem: i have some stdout which comes from a command and i want it in a file on another machine.

i could first send it to a temp file, scp that over, and then remove the temp file; but instead, i’ll just:

echo here is some stdout | ssh example.com tee filename

which gives me the added bonus of seeing the contents fly by my screen as they get sent through tee.