Sponsored Content
Full Discussion: Ping inside FOR loop
Top Forums Shell Programming and Scripting Ping inside FOR loop Post 302477473 by courteous on Sunday 5th of December 2010 10:49:52 AM
Old 12-05-2010
Hi ctsgnb,
the "default option" works also without the colon. Smilie

I'd be most grateful for any help on 2. question (on choosing max. TTL) ...
and of course any correction on my "thinking" in 1. point (on -c switch). Smilie

ADD: I think I should let ping run inside the for loop, until I'd get ECHO_REPLY, and then break the for loop.
Code:
PING www.l.google.com (209.85.135.99) 56(84) bytes of data.
From 209.85.253.26 icmp_seq=1 Time to live exceeded

--- www.l.google.com ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms
Here should be the break-like statement: above is TTL_EXPIRED, below ECHO_REPLY. Is that right?
PING www.l.google.com (209.85.135.99) 56(84) bytes of data.
64 bytes from mu-in-f99.1e100.net (209.85.135.99): icmp_req=1 ttl=250 time=45.0 ms

--- www.l.google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 45.052/45.052/45.052/0.000 ms


Last edited by courteous; 12-05-2010 at 11:55 AM..
 

10 More Discussions You Might Find Interesting

1. IP Networking

ping loop

i need to write a script that can loop through ej.192.162.0.0 to 192.162.0.256 find the ones that are connected and the ones not connected write the name , ip address and connection status of each one in a file to later use it in perl to create a web page with the information thanks guys (1 Reply)
Discussion started by: djbilly
1 Replies

2. Shell Programming and Scripting

help: infinant loop script - host ping test

need to check on some hosts and send an email if there status changes I wanna put together a script in bash that will allow me to check the up/down state of a single host via ping i want it to run in a continuous loop so I can just fire the script and forget about it(dont want cron to drive... (2 Replies)
Discussion started by: zeekblack
2 Replies

3. Shell Programming and Scripting

variable inside variable inside loop headache

Hi Gurus I have a file called /tmp/CMDB which looks like this serial: 0623AN1208 hostname: server1 model: x4100 assetID: 1234 I am writing a for loop that will go through this file line by line creating a variable of itself. Using the first iteration of the loop (i.e. the first line) as... (6 Replies)
Discussion started by: hcclnoodles
6 Replies

4. Shell Programming and Scripting

Using variables created sequentially in a loop while still inside of the loop [bash]

I'm trying to understand if it's possible to create a set of variables that are numbered based on another variable (using eval) in a loop, and then call on it before the loop ends. As an example I've written a script called question (The fist command is to show what is the contents of the... (2 Replies)
Discussion started by: DeCoTwc
2 Replies

5. Shell Programming and Scripting

Using 'su' inside a loop

Hi, I am using su within a for loop. As you might expect, it prompts for password during each loop execution. Here is my piece of code: for i in $LIST do if then DATABASE=`echo $i | awk -F "|" '{ print $1 }'` USER_ID=`echo $i | awk -F "|" '{ print $2 }'` su - apstage -c... (1 Reply)
Discussion started by: sugan
1 Replies

6. Shell Programming and Scripting

BASH loop inside a loop question

Hi all Sorry for the basic question, but i am writing a shell script to get around a slightly flaky binary that ships with one of our servers. This particular utility randomly generates the correct information and could work first time or may work on the 12th or 100th attempt etc !.... (4 Replies)
Discussion started by: rethink
4 Replies

7. Programming

Perl Ping Loop

Hi All i have an issue with ping, we are using dhcp and so if the machine has been offline and i ping it, i get " ping: unknown host <hostname> is there a way i can stick a loop somewhere so it would keep trying when it got the unknown host error and then when the machine came back online... (2 Replies)
Discussion started by: ab52
2 Replies

8. Shell Programming and Scripting

If inside If loop

Hi All, Below is the very simple code snippet but it si giving me syntax error #!/bin/bash #To ensure If JMS directory exists or not ServerName=$(hostname) #To ensure If JMS directory exists or not echo $ServerName if ; then echo "Inside First If" if ; then echo 'JMS... (4 Replies)
Discussion started by: sharsour
4 Replies

9. UNIX for Dummies Questions & Answers

Write a while loop inside for loop?

I'm taking a unix class and need to countdown to 0 from whatever number the user inputs. I know how to do this with a while or until loop but using the for loop is throwing me off.... I know I can use an if-then statement in my for loop but can I include a while loop in my for loop? (3 Replies)
Discussion started by: xxhieixx
3 Replies

10. IP Networking

Loop in /24 Subnet, No ping beyond .1 and .2

Running 3650 switch. I have this odd issue where I cannot get 4 new Centos 7 boxes pinging out on public IPs (nor pinging in), only gateway .1 and first public IP .2 This is what I see, which doesn't look normal. How do I fix this? The server itself is configured fine (Centos 7) # cat... (0 Replies)
Discussion started by: Bashed
0 Replies
TRACEROUTE6(8)						 System Manager's Manual: iputils					    TRACEROUTE6(8)

NAME
traceroute6 - traces path to a network host SYNOPSIS
traceroute6 [-dnrvV] [-i interface] [-m max_ttl] [-p port] [-q max_probes] [-s source] [-w wait time] destination [size] DESCRIPTION
Description can be found in traceroute(8), all the references to IP replaced to IPv6. It is needless to copy the description from there. SEE ALSO
traceroute(8), tracepath(8), ping(8). HISTORY
This program has long history. Author of traceroute is Van Jacobson and it first appeared in 1988. This clone is based on a port of tracer- oute to IPv6 published in NRL IPv6 distribution in 1996. In turn, it was ported to Linux by Pedro Roque. After this it was kept in sync by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>. And eventually entered iputils package. SECURITY
tracepath6 requires CAP_NET_RAWIO capability to be executed. It is safe to be used as set-uid root. AVAILABILITY
traceroute6 is part of iputils package and the latest versions are available in source form at http://www.skbuff.net/iputils/iputils-cur- rent.tar.bz2. iputils-101006 12 April 2011 TRACEROUTE6(8)
All times are GMT -4. The time now is 06:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy