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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s