Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to redirect output to ssh and stdout

How to redirect echo to stdout and ssh?
So something like this:

echo "Hello" | ssh ...@... "cat >> Log/my.log"

I want to see both Hello on the screen as well as in the ssh output.
Is that possible?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

One possibility might be

echo "Hello" | ssh user@host "tee -a Log/my.log"

Note that the text you see in the terminal is sent from remote host via ssh.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading