The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 11-17-2008
veerumahanthi veerumahanthi is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 1
SHELL SCRIPT error

Hi I am a new member,can any one help me


#!/bin/sh
# 'clear'
for i in $(seq -w 15 37)
do
#echo $i
string1= wget --dns-timeout=0.001 http://napdweb${i}.eao.abn-iad.ea.co.../test/test.jsp;
if [ "$string1" = "$Resolving napdweb${i}.eao.abn-iad.ea.com...failed connection timed out." ];
then
echo "May be napdweb${i}.eao.abn-iad.ea.com...has hung, please restart."
else
echo "Everything is good and fine"
fi
done
~


After the wget command is executed,i assigned that string to another string called string1. so in the next step when that string1 is equal to a particular string as i given in program, it should display a msg as server is down please restart otherwise else part should be displayed.I dont know why my logic is not running can any one solve it plssssssss