Bash script to add whatever ip address to ping automatically

I want a bash script that has a input where you would add the website or ip address into it and it pings for you. You can even use the whois command

Give an example of the name of this script and how it would be run. Would the ip addresses be in the script, given on the command line or stored in a data file? Typing in ping xxx.xxx.xxx.xxx is pretty simple, so what increased function do you expect in this bash script?

Thank You,

Create ping which will ask the user to enter the a web site or address they want to ping

It’s of course doable. But the script would require more or as much typing as the task itself.

Copy/paste the script posted here http://forums.opensuse.org/english/other-forums/development/programming-scripting/452886-dialog-boxes-bash-scripts-2.html#post2391088 and save it as /usr/bin/popup.

Then use this script:


#! /bin/bash
popuplib=/usr/bin/popup

 -f $popuplib ] && . $popuplib || exec printf "File not found: %s
" $popuplib

ping $(entry "ping me")

Under Gnome, you will see this:

http://img820.imageshack.us/img820/4386/pingmegnome.png

Under KDE, you will see this:

http://img189.imageshack.us/img189/7033/pingmekdepng.png

If you’re neither using Gnome nor KDE, make sure “zenity” is installed.

please try again wrote:
> Copy/paste the script posted here http://tinyurl.com/3jn2w35 and save it

did you just solve some homework?

On 09/11/2012 02:26 PM, renegadeviking wrote:
>
> Create ping which will ask the user to enter the a web site or address
> they want to ping

is this a home work assignment?

if not, you need to know that you are asking for a script that is not
needed…not at all…instead, just open a terminal and type


ping

then either the IP or address you wish, and press enter…like this:


denver4d@linux-os114:~> ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_req=1 ttl=50 time=43.3 ms
64 bytes from 8.8.8.8: icmp_req=2 ttl=50 time=42.7 ms
64 bytes from 8.8.8.8: icmp_req=3 ttl=50 time=42.7 ms

or


denverd@linux-os114:~> ping google.com
PING google.com (173.194.78.138) 56(84) bytes of data.
64 bytes from wg-in-f138.1e100.net (173.194.78.138): icmp_req=1 ttl=49
time=57.1 ms
64 bytes from wg-in-f138.1e100.net (173.194.78.138): icmp_req=2 ttl=49
time=56.9 ms
64 bytes from wg-in-f138.1e100.net (173.194.78.138): icmp_req=3 ttl=49
time=56.8 ms
64 bytes from wg-in-f138.1e100.net (173.194.78.138): icmp_req=4 ttl=49
time=56.9 ms

to stop either while running press Ctrl+c

that is all there is to it–no bash script required (unless this is a
homework assignment…and, if it is you need to do that yourself)

well, if you ask for a bash script because you don’t want to open a
terminal: i’d recommend you get over that want.


dd

On 09/11/2012 05:40 PM, Dave Howorth wrote:
> did you just solve some homework?

that is my guess!!


dd

lol!

It can not be the expected solution.