LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   BASH shell script help (http://www.linuxquestions.org/questions/programming-9/bash-shell-script-help-21567/)

ewarmour 05-22-2002 04:06 PM

BASH shell script help
 
I want to make shell script that takes a list of host names on my network as command line arguments and displays whether the hosts are up or down, using the ping command to display the status of a host and a for loop to process all the host names. Im new to shell scripting so Im not quite sure where to start with this. Thanks for any help -E

Tinkster 05-22-2002 06:13 PM

Re: BASH shell script help
 
Quote:

Originally posted by ewarmour
I want to make shell script that takes a list of host names on my network as command line arguments and displays whether the hosts are up or down, using the ping command to display the status of a host and a for loop to process all the host names. Im new to shell scripting so Im not quite sure where to start with this. Thanks for any help -E
Heh ... what you want is not help, it's someone else to do your job m8 ;)

Cheers,
Tink

P.S.: I'm new at driving, could you go to the supermarket for me? :D

ewarmour 05-23-2002 10:57 AM

Thanks for nothing
 
Actually I was hoping for a push in the right direction. I got a link form a post at another forum http://www.tldp.org/LDP/abs/html/index.html this is good help.

-E

PS Thanks for wasting my time

acid_kewpie 05-23-2002 11:43 AM

please do not double post messages.... did you not have time to read the terms of using this site?
http://www.linuxquestions.org/questi...threadid=21568

ewarmour 05-23-2002 12:22 PM

Non-*NIX Forums
 
I saw that this was a non-*nix forum, and I had a Unix question. My bad, wont happen again. -E :(

Tinkster 05-23-2002 04:47 PM

Re: Thanks for nothing
 
Quote:

Originally posted by ewarmour
PS Thanks for wasting my time [/B]
Lovely attitude :)

http://www.tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html

Cheers,
Tink

ewarmour 05-23-2002 05:00 PM

Like that do ya?
 
Just a little busy, clients from hell with spineless project managment... My bad. Thanks for your help though, I pretty much got it sorted out. -E

vfs 05-24-2002 08:55 AM

Try this baby johnny:

#!/bin/sh

for i in $@
do
ping $i >> /my/log/file
done

# EOF

All you have to do is read regularly the log. Or mail it for U.

HTH,

vfs

vfs 05-24-2002 08:57 AM

Forgot to put this in the code: Try learning ping options (which I don't know) to ping once or for a predetermined time, or you'll end with a big log of nothing...

sorry,
vfs


All times are GMT -5. The time now is 10:23 PM.