From owner-freebsd-questions@FreeBSD.ORG Fri Jan 25 01:10:24 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CE80F1F7 for ; Fri, 25 Jan 2013 01:10:24 +0000 (UTC) (envelope-from johnl@iecc.com) Received: from leila.iecc.com (leila6.iecc.com [IPv6:2001:470:1f07:1126:0:4c:6569:6c61]) by mx1.freebsd.org (Postfix) with ESMTP id 38F3C1B8 for ; Fri, 25 Jan 2013 01:10:24 +0000 (UTC) Received: (qmail 39008 invoked from network); 25 Jan 2013 01:10:23 -0000 Received: from leila.iecc.com (64.57.183.34) by mail1.iecc.com with QMQP; 25 Jan 2013 01:10:23 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=iecc.com; h=date:message-id:from:to:cc:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:vbr-info; s=5101db7f.xn--btvx9d.k1301; i=johnl@user.iecc.com; bh=N9/Piv0q3bnAcV7nSiSVbRB0SKVc/vUQpc3mFkXqTOg=; b=QgW9M6N9yWHFxmrHGChTxbSJCyeyjb265aFC0bw/RS4V7+lEg9wNF59iZ2EWcH7DtGnr2kLstKD2gkMyxtInNS6zm2/sP1kOxSA/cfW7PigruAgX8aYUaS+bwM/Y6nwVF2qd1eEBc1vHQd9pV1m1wVrZapeOQOikW+BGqAKkwXM= VBR-Info: md=iecc.com; mc=all; mv=dwl.spamhaus.org Date: 25 Jan 2013 01:10:01 -0000 Message-ID: <20130125011001.4689.qmail@joyce.lan> From: "John Levine" To: freebsd-questions@freebsd.org Subject: Re: sh script ? In-Reply-To: <5101786C.3070209@a1poweruser.com> Organization: X-Headerized: yes Mime-Version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit Cc: fbsd8@a1poweruser.com X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2013 01:10:24 -0000 >I get this message [: 10.0.10.21: bad number on this code > > [ "${saved_ip}" -eq "${used_ip}" ] && echo "good match" > >Both variables have valid ip addresses in them. >Why does it think the variable content is a number and not text? >What am I doing wrong? My guess would be that you didn't read the man page for the "test" (sometimes spelled "[" ) command.