Running a script on a different Sever

Guys,

I want to run a script located on a different server from my pc.
Let say the server has an IP of 1.1.10.2/16 and the script path is:

/home/user/bin/check.sh

The script scans for all available devices on the lan.

My pc has an IP of 1.1.15.4/16 and I can ping the sever and can connect to it, but I want to do things from my Sun.

Here is my code

for x in $check.sh
do
ping $x
done
/bin/ksh: check.sh: not found

Obviously I don't know how to tell my code how to connect to the server
I have asked and none of my friends at work know how to do this.

thank you
Tony

Hmm.... could you not just make things easy on yourself and SSH into the machine and run the script from there (or just copy the script to your PC using scp and run it locally)??

The syntax of your code will not work - it is looking for a variable called "check.sh". If you had a list of IP addresses you could try something like

while read line
do
    ping $line 2
done < my_list_of_ips

as you're using Solaris this should just give a nice "x.x.x.x is alive" message or timeout after 2 seconds (that's what the "2" is there for, as the default is 20 seconds and with a long list of IPs you'll be waiting a while if hosts are offline - this is Solaris ping - adjust the syntax for your OS)

Cheers
ZB
http://www.zazzybob.com

Thank you zazzybob

I was actually trying to make things easier on myself. You see, many users have access to /home/user. The code I posted is an example, I'm actually adding more stuff into it like sensitive information that I do not wish to share to the whole group. Thats why I want to run it from my pc.

I wonder if I add the fully-qualifed name for check.sh on my .kshrc profile works....

tony

OK I have scp the file to my PC and it works.

Thank u