From owner-freebsd-questions@FreeBSD.ORG Fri Dec 16 05:54:01 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E7E1816A41F for ; Fri, 16 Dec 2005 05:54:01 +0000 (GMT) (envelope-from anirban.adhikary@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7CFE443D4C for ; Fri, 16 Dec 2005 05:53:59 +0000 (GMT) (envelope-from anirban.adhikary@gmail.com) Received: by zproxy.gmail.com with SMTP id 8so544433nzo for ; Thu, 15 Dec 2005 21:53:59 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=BuZtHtusVi26ikODiZmryHkrjWM+5nsANMJT9ZrPybguHa48iDCkLaxydq8HS2EyGKZgDkumt7ocltU3Nv/zTj6/RagX0uynmVS5DCZi4WbYUdOWVlQTd4FnlGYuVxttyxL1zsskRKpQ66fy5V0TcNjDy8tVlQcODrJEvWxcxf0= Received: by 10.36.71.10 with SMTP id t10mr2635309nza; Thu, 15 Dec 2005 21:53:58 -0800 (PST) Received: by 10.36.220.80 with HTTP; Thu, 15 Dec 2005 21:53:58 -0800 (PST) Message-ID: <71c73b070512152153h507fae3eo22e3b2d52df1202f@mail.gmail.com> Date: Fri, 16 Dec 2005 11:23:58 +0530 From: Anirban Adhikary To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: shell script doesnot executing X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Dec 2005 05:54:02 -0000 Hi guys This is Anirban here. I have the problem again with the previous shell script.Which was Write a shell script that will check whether a server is up or not(on ping) & log the report to a file. I have tried to write the program in the following way #! /bin/sh echo -n "Enter the IP or Hostname of the Server" read host #echo $host ping -c2 $host &>file2 if [ $? =3D 0 ];then echo "Server is up and working" $host else echo"Server is not up and not working" $host fi But when I am trying to execute the program in the case when the server is not up it is showing The server is up and running but from the ping statistics it is showing tha= t 100% loss is occured.I am not able to point the problem.(i used the chmod 755 filename before executing the program) Please help me.And one more thing is there any other option to check the connectivity without ping command? with regards Anirban