The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
AIX - Cant ping Netghost AIX 1 10-03-2006 06:38 PM
Ping sam70 UNIX for Dummies Questions & Answers 1 08-03-2005 12:56 AM
ping csaunders AIX 1 04-24-2005 05:54 PM
ping nemex UNIX for Dummies Questions & Answers 2 12-12-2002 06:08 AM
About Ping S.Vishwanath IP Networking 4 11-09-2002 10:06 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-15-2004
jaber87 jaber87 is offline
Registered User
  
 

Join Date: Apr 2004
Posts: 6
Post 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 (permalink)  
Old 04-15-2004
google's Avatar
google google is offline Forum Advisor  
Moderator
  
 

Join Date: Jul 2002
Location: Atlanta
Posts: 740
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 (permalink)  
Old 04-15-2004
norsk hedensk norsk hedensk is offline Forum Advisor  
Registered User
  
 

Join Date: Jul 2002
Location: new york
Posts: 1,025
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 (permalink)  
Old 04-16-2004
jaber87 jaber87 is offline
Registered User
  
 

Join Date: Apr 2004
Posts: 6
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 (permalink)  
Old 04-16-2004
jaber87 jaber87 is offline
Registered User
  
 

Join Date: Apr 2004
Posts: 6
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 (permalink)  
Old 04-16-2004
norsk hedensk norsk hedensk is offline Forum Advisor  
Registered User
  
 

Join Date: Jul 2002
Location: new york
Posts: 1,025
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 (permalink)  
Old 04-16-2004
norsk hedensk norsk hedensk is offline Forum Advisor  
Registered User
  
 

Join Date: Jul 2002
Location: new york
Posts: 1,025
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.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:54 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0