These are a few quick tips how to make it real. First what you need: two computers

, both to have bash and ssh installed and 'authorized_keys' file with public rsa key from the caller machine (only if you want to have communication without password typing)
Now let's do it :
1. Make a simple bash script which we want to execute on a remote machine. You are able to use this one:
#!/bin/bash
echo "Greetings from "$(uname -n)
exit 0
2. Execute this script on a remote machine by running this:
cat simple.sh | ssh user@remote /bin/bash
You should see this output:
Greetings from remote
It's unbelievably simple isn't it ? You send content of the script file through the pipe to a remote machine on which you connect via ssh and where you run the bash in which you execute the script that come from your computer .

Due to these nice features i do really love unix