The UNIX and Linux Forums  


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
Adding specific text and spaces to each line in a text file hertingm Shell Programming and Scripting 4 08-25-2008 03:34 PM
parse through one text file and output many sophiadun UNIX for Dummies Questions & Answers 14 02-20-2008 06:08 AM
Extract text in 2 columns of output file. Danish Shakil Shell Programming and Scripting 2 10-19-2007 11:03 AM
I want to copy the text output from a 'nohup.out' file. Iamthe great UNIX for Dummies Questions & Answers 3 05-01-2007 01:41 PM
grep multiple text files in folder into 1 text file? coppertone UNIX for Dummies Questions & Answers 7 08-23-2002 03:50 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 10-23-2008
Lasthitlarry Lasthitlarry is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 6
Ping text file of ip addressese and output to text file

I am basically a scripting noob, I have some programming logic, and I wouldn't post here if my 3 hours of searching actually found something.

So far this is what I have:

"

#! /bin/ksh
List=./pinglist1.txt

cat $List | while read ip
do
Pingable=""
ping $ip -n 2 | awk '/100%/ {print "no"}' |read Pingable
if [[ "$Pingable" != "no" ]]
then
print $ip "PINGS">>pingresults.txt
else
print $ip "DOESN'T PING">>pingresults.txt
fi
done

"

pinglist1.txt is just a plain file with IP addresses.

I just want the script to ping each IP address and report if it is pinging or not to a text file.

Please and thanks.
 

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 05:48 PM.


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