Ping shell script - need urgent help


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Ping shell script - need urgent help
# 8  
Old 04-25-2013
it should work , what OS you are using ?

---------- Post updated at 07:13 AM ---------- Previous update was at 07:06 AM ----------

Try this ,

Code:
cat inputfile |xargs -n1 ping 2>&1 | awk '{if($0~/alive/){print $1" up"}else{print $NF" down"}}'

# 9  
Old 04-25-2013
x86_64 x86_64 x86_64 GNU/Linux

---------- Post updated at 06:14 AM ---------- Previous update was at 06:13 AM ----------

For the above one also same error
# 10  
Old 04-25-2013
Oops.. Didnt realise its GNU Linux until now . Sorry the oneliner would work well on Solaris but not on linux. I will see if i can figure out some oneliner for Linux Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script urgent help please

Hello, I have below string, even I have hundreds of lines in a file. I want to exactly match last two consecutive strings. 2017-09-30|ACBD,TVF|01234|NULL|18|NULL|686091802|BANK OF ABCD, LIMITED, THE|2017-09-30 00:00:00 I want to extract the string 2017-09-30 00:00:00 How can I do... (1 Reply)
Discussion started by: shellquery26666
1 Replies

2. Shell Programming and Scripting

Shell script to ping multiple servers

Hi I did the following script to ping multiple servers, but I keep on receiveing duplicate emails for one server that is down: #!/bin/bash date cat /var/tmp/servers.list | while read output do ping -c 1 "$output" > /dev/null if ; then echo "node $output is up" else ... (10 Replies)
Discussion started by: fretagi
10 Replies

3. Shell Programming and Scripting

URGENT Reading a file and assessing the syntax shell script URGENT

I am trying to write a shell script which takes an input file as an arguement in the terminal e.g. bash shellscriptname.sh input.txt. I would like for the file to be read line by line each time checking if the .txt file contains certain words or letters(validating the syntax). If the line being... (1 Reply)
Discussion started by: Gurdza32
1 Replies

4. Shell Programming and Scripting

Need shell script to Telnet multiple node , Ping some IP and print output

Hi Team, Need shell script to Telnet multiple node , Ping some IP and print output like pass or fail. Need this script to check reachability of multiple nodes at same time. Help me. I use this but not working... Eg. in this script i need to telnet... (4 Replies)
Discussion started by: Ganesh Mankar
4 Replies

5. Shell Programming and Scripting

Unix Shell Script to ping systems & make a log

Hi, I need to ping all the systems in my network and then create a log for the ones, from where I successfully get the ping-response (ICMP packet). Now, I've used the ping command successfully, but am unable to use 'grep' command to locate the IPs for which the ping was successful (so that I... (5 Replies)
Discussion started by: psychoTHEIST
5 Replies

6. Shell Programming and Scripting

Shell Script for ping, Linux

I woul like to create a script in order to make a ping to a server and save in a variable a 1 if respond or a 0 if it doesnt. Then with that I could make a graffic of the server, for how long it is up.:b: So far I have this: if ; then #if the ip respond the ping shows online echo... (3 Replies)
Discussion started by: jsebastiang0
3 Replies

7. Shell Programming and Scripting

shell script for ping

hi anyone, i want shell script for ping command. any one post here............ (10 Replies)
Discussion started by: rameshreddy.ema
10 Replies

8. Shell Programming and Scripting

Shell script to ping a range of IPs

Hi Can someone give me a shell script that can ping a range of IPs and return IPs which are not pingable. Range for example say 192.168.0.1 to 192.168.0.50 and whichever are not pingable then return the IP. Thanks for your help (3 Replies)
Discussion started by: tannu
3 Replies

9. Shell Programming and Scripting

(Urgent):Creating flat file using sql script and sqlplus from UNIX Shell Script

Hi, I need help urgently for following issue. Pls help me to resolve this issue. I am calling sql script file(file1.sql) from UNIX Shell Script(script1.ksh) using sql plus and trying to create flat file that contains all records returned from SQL query in SQL script(file1.sql) I given... (6 Replies)
Discussion started by: praka
6 Replies

10. Shell Programming and Scripting

shell script queries: $home; broadcast ping

Dear all, This is the Bionic Fysh again. I have two quick questions: 1- when writing shell scripts, how does one allow the tilda ~ into the script ? e.g ls ~; ls ~me; user=you; ls ~$user (N.B I think that for this one you need: ls `~$user`) 2- In FreeBSD 4.0, I would like for a... (6 Replies)
Discussion started by: bionicfysh
6 Replies
Login or Register to Ask a Question