ENJOY THE SILENCE
Marigan's Weblog
All | General | Java | Music | NetBeans | Unix
« Previous day (Aug 13, 2005) | Main | Next day (Aug 15, 2005) »
20050814 Sunday August 14, 2005
How the vi editor would seem if it has been made by Microsoft
Microsoft VIM

Aug 14 2005, 10:25:24 PM CEST Permalink Comments [70]

Executing scripts on a remote machine
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 :)

Aug 14 2005, 09:29:17 PM CEST Permalink Comments [5]