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
Trackback URL: http://blogs.sun.com/marigan/entry/executing_scripts_on_a_remote
Posted by sathish on September 13, 2005 at 01:27 PM CEST #
Posted by sathish on September 13, 2005 at 01:46 PM CEST #
Posted by nicky on October 26, 2005 at 08:50 AM CEST #
Posted by marigan on January 16, 2006 at 11:56 PM CET #
Posted by Mohannad Hussain on June 21, 2007 at 04:33 PM CEST #