![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to make your bash script run on a machine with csh and bash | npatwardhan | Shell Programming and Scripting | 3 | 11-19-2008 04:17 AM |
| passing variable from bash to perl from bash script | arsidh | Shell Programming and Scripting | 10 | 06-04-2008 01:25 PM |
| bash script | pooppp | Shell Programming and Scripting | 6 | 05-29-2008 03:46 AM |
| Why generate "ash and bash" different output for same bash script? | s. murat | Shell Programming and Scripting | 0 | 05-26-2008 08:19 AM |
| please help with a bash script | milagros | Shell Programming and Scripting | 1 | 05-13-2007 10:43 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Bash Script Help
Hello, I am very new at Shell Scripting, just begining to learn a little. What I am trying to do is to ping a remote host. If the host is up and accepting pings, I want to connect via telnet. If it is down just end ofcourse. This is what I have so far
#! /bin/bash echo "Input an IP address to Ping" read IP echo "How many times do you want to Ping?" read Count echo "Pinging $IP $Count times" ping $IP -c $Count || { echo "Nobody Home Go Away" >&2; exit; } rup $IP || { echo "Host is Up" >&2; exit; } This will ping and report to the user if the remote host is up or down. What I am having trouble doing is going from a good ping to starting the telnet process. Say I have a good ping. How do I say in script, if ping is good, then start telnet. Do I need to use some kind of varible? Please help. Thank you very much. Joe |
| Bookmarks |
| Tags |
| bash, ping, script, shell script, shell scripting, telnet, unix scripting, unix scripting basics |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|