I think once you see the separate parts, you'll understand it quite well. You might try the pipes in #10 above again.
Quote:
Originally Posted by trendal
In a terminal I tried this:
Code:
cat route-cost.sh | ssh username@10.1.1.19
It runs on the remote machine ...
|
The "cat" part runs on the local machine, via the terminal. The "ssh" part runs on the local machine, too, but as you have it without anything after the username + host, it will just run a shell on the remote machine. The pipe is not a parameter, it connects the two so that the output from "cat" becomes the input for "ssh"
If you use "cat" a second time, but over on the remote machine instead of the local one, then you can use it to capture the incoming text with the help of a redirect. Here, "ssh" is used to run "cat" with a redirect. The redirect captures the output "cat" but "ssh" provides input to "cat" which it gets from the output of the first "cat" via the pipe.
Code:
cat route-cost.sh | ssh username@10.1.1.19 "cat > owhereami.txt"
Which machine did "owhereami.txt" end up on and what are its contents?