ping -t


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ping -t
# 1  
Old 04-15-2004
Java ping -t

I need a script that recieves an IP adress and a number of seconds as arguments. and display a massage if the IP replies or not.
# 2  
Old 04-15-2004
Great to hear that you have needs! By the way, are you asking or telling? How much of the script have you put together already?
# 3  
Old 04-15-2004
ping already does this. theres no need that i am aware of to write a script to do this.

are you under some unique circumstances? please share with us your situation so we can help you further.
# 4  
Old 04-16-2004
Quote:
Originally posted by google
Great to hear that you have needs! By the way, are you asking or telling? How much of the script have you put together already?

first I am asking for a script. and I need it to be run in tcsh shell.
I tried to do one, but I always stuck in endless loop. so please help me.
# 5  
Old 04-16-2004
Quote:
Originally posted by norsk hedensk
ping already does this. theres no need that i am aware of to write a script to do this.

are you under some unique circumstances? please share with us your situation so we can help you further.
yes. I need it to be a part of a code that I'm working on.
please reply as soosn as possible.
# 6  
Old 04-16-2004
well first, post the script that you have already written. then we can go from there. very rarely will you find someone who has the time to write out a script for you, especially if you are not willing to write one out on your own. not only that, but it can be insulting asking people to do work for you. were here to help, not to do work for you.
# 7  
Old 04-16-2004
basically, all you would have to do is see the man page for ping.

Code:
ping -c $count -t $time_to_live $host_name


so in the script that you are writing, you could first either assign $count whatever value you want, or ask for user input. this argument should be in there otherwise ping will go on for a while. take userinput for the -t flag and store it in $time_to_live

and finally define the $host_name of the machine to be pinged.

to take command line arguments with bash, go to tldp.org and search for the advanced bash shell scripting guide.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Ping test sends mail when ping fails

help with bash script! im am working on this script to make sure my server will stay online, so i made this script.. HOSTS="192.168.138.155" COUNT=4 pingtest(){ for myhost in "$@" do ping -c "$COUNT" "$myhost" &&return 1 done return 0 } if pingtest $HOSTS #100% failed... (4 Replies)
Discussion started by: mort3924
4 Replies

2. Shell Programming and Scripting

How to get reason for ping failure using perls Net::Ping->new("icmp");?

Hi I am using perl to ping a list of nodes - with script below : $p = Net::Ping->new("icmp"); if ($p->ping($host,1)){ print "$host is alive.\n"; } else { print "$host is unreacheable.\n"; } $p->close();... (4 Replies)
Discussion started by: tavanagh
4 Replies

3. IP Networking

PING

I am unable to ping my remote server.My server is unable to ping the same. both are able to ping the gateway. both the ip's are on same network.i use a proxy tunnel on my remote server.Help if any clues. (6 Replies)
Discussion started by: oslbhavana
6 Replies

4. Shell Programming and Scripting

Animation Ping on Solaris Like Cisco Ping

Hi, I develop simple animation ping script on Solaris Platform. It is like Cisco ping. Examples and source code are below. bash-3.00$ gokcell 152.155.180.8 30 Sending 30 Ping Packets to 152.155.180.8 !!!!!!!!!!!!!.!!!!!!!!!!!!!!!. % 93.33 success... % 6.66 packet loss...... (1 Reply)
Discussion started by: gokcell
1 Replies

5. IP Networking

Can't Ping

I have an old MP-Ras Unix system. I have setup netowkring but am unable to ping any local network pcs or the default gateway. If i use the arp -a command I receive the correct mac address for all connected pcs but I cannot ping anything except the local address. Any help would be appreciative. ... (7 Replies)
Discussion started by: Rutgerncas
7 Replies

6. Linux

Not able to ping

Hi All, Need your help one more time. I am trying to ping a linux machine which is not responding to ping. However traceroute can reach the machine and I can log in to it by ssh. I have checked /proc/sys/net/ipv4/icmp_echo_ignore_all it is already set as "0". It is not happening in the... (1 Reply)
Discussion started by: ailnilanjan
1 Replies

7. UNIX for Dummies Questions & Answers

Ping

Hi , I have one system installed on Linux Red Hat 3.0. I have ip of system 3.156.168.*** and i want to ping some port that is on this IP which command i can do this? sam70 (1 Reply)
Discussion started by: sam70
1 Replies

8. AIX

ping

We can ping out but the return never comes back even to localhost ping localhost PING loopback: (127.0.0.1): 56 data bytes 64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=0 ms it just sits there.... any ideas, any files to check (1 Reply)
Discussion started by: csaunders
1 Replies

9. UNIX for Dummies Questions & Answers

ping

Hi there hope list can help I'm looking for a command that does the following lets say i ping a server 00.00.000.00 and this server is up and running how do i get the ping command to return a UP or a Down meaning if the command is true do this if the command is False do this ... (2 Replies)
Discussion started by: nemex
2 Replies

10. IP Networking

About Ping

Hi, When I pinged a machin, I got to be seen a different kind of reply from that machine. This is as below : "Reply from 136.128.11.116: Source quench received." Which I felt like an un-usual message. So what does this mean. Regards & Thanks in advance. Vishwa. (4 Replies)
Discussion started by: S.Vishwanath
4 Replies
Login or Register to Ask a Question