in reply to Backticks and Sub Programs

To check if the other computer is online, the best way depends on that computer and your connection to it (you meaning the machine running the script). If you want to ensure that some service (like a webserver) is running on the other computer, it's probably best to check that service directly, not just whether the computer is alive. If you still just want to check for the computer to be alive, the best is probably to use the ping program. If the machine doesn't answer pings, use nmap -sP -PA and possible give it port numbers too.