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




Thread: ping -t
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #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.