So, I am trying to create an ask system there one computer (,lets call it computer nr1,) asks another computer (computer nr2) a question. The answer will be replied through a textdocument in the computer nr1. The question nr1 can be asking doesn't really matter atm, but let say nr1 ask when nr2 last rebooted.
I am using ssh to ask the question but it doesn't work. I'm sshing nr1 to nr2 and then, for example, asking when it last rebooted by:
who -b | awk '{print $(NF-1)" "$NF}' >> existing_file_in_nr1.txt
But when I run the command it places the answer in computer nr2. What do I do if i want my reply to go to computer nr1 instead of computer nr2 when sshed from nr1 to nr2?
Thanks.