From owner-freebsd-questions@FreeBSD.ORG Sun May 15 18:09:01 2005 Return-Path: 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 663AD16A4CE for ; Sun, 15 May 2005 18:09:01 +0000 (GMT) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id EB80B43D82 for ; Sun, 15 May 2005 18:09:00 +0000 (GMT) (envelope-from phusion2k@gmail.com) Received: by rproxy.gmail.com with SMTP id g11so1115826rne for ; Sun, 15 May 2005 11:09:00 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=mx1OocyheYPwTzW5Glejo80+eBDxFtUHURJCvVkA2OKzA7WBt4fofSEVeGcv7Jb/k64wVgmppM3yphw81z1iaG9WoU9PsT3ID/mkAnxhThc1A/e2cuejciCF+BDyFAaGJ49IG+D56wl57cDJsn0bebKTWl9P9zpK7ECTY+e2FFM= Received: by 10.11.1.23 with SMTP id 23mr44927cwa; Sun, 15 May 2005 11:09:00 -0700 (PDT) Received: by 10.11.100.43 with HTTP; Sun, 15 May 2005 11:09:00 -0700 (PDT) Message-ID: Date: Sun, 15 May 2005 13:09:00 -0500 From: Phusion 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 Subject: Help with Expect Script X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Phusion List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2005 18:09:01 -0000 I'm new to writing expect scripts and need some help. The script will telnet to a host and run some commands. I want the script to ping the host to see if it's alive first before it telnets into it. Also, I know the host is pingable meaning it responds to pings. If the host doesn't respond to a ping I want it to log that to a log file and then quit. I already know how to telnet to the host, but not sure about the ping part and writing it to a log file. Could you please reply to this email with a little example script. Thanks. Phusion