From owner-freebsd-questions@FreeBSD.ORG Thu Jan 24 18:28:48 2013 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0C98AE69 for ; Thu, 24 Jan 2013 18:28:48 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id BAFF6CD5 for ; Thu, 24 Jan 2013 18:28:47 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.31]) by ltcfislmsgpa05.fnfis.com (8.14.5/8.14.5) with ESMTP id r0OISdj2003768 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Thu, 24 Jan 2013 12:28:39 -0600 Received: from LTCFISWMSGMB21.FNFIS.com ([10.132.99.23]) by LTCFISWMSGHT03.FNFIS.com ([10.132.206.31]) with mapi id 14.02.0309.002; Thu, 24 Jan 2013 12:28:39 -0600 From: "Teske, Devin" To: Fbsd8 Subject: Re: sh script ? Thread-Topic: sh script ? Thread-Index: AQHN+mCglLVBzr+w8EqGC7NM2jem0g== Date: Thu, 24 Jan 2013 18:28:38 +0000 Message-ID: <13CA24D6AB415D428143D44749F57D7201E9D6B1@ltcfiswmsgmb21> References: <5101786C.3070209@a1poweruser.com> In-Reply-To: <5101786C.3070209@a1poweruser.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.14.152.7] Content-Type: text/plain; charset="us-ascii" Content-ID: <816BEBE2D6BD374E9AB71F6C08DC0D4E@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.9.8327, 1.0.431, 0.0.0000 definitions=2013-01-24_07:2013-01-24,2013-01-24,1970-01-01 signatures=0 Cc: FreeBSD questions 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: Thu, 24 Jan 2013 18:28:48 -0000 Use =3D for string comparison with the [ built-in and -eq for numerical com= parison. --=20 Devin On Jan 24, 2013, at 10:07 AM, Fbsd8 wrote: > I get this message [: 10.0.10.21: bad number on this code >=20 > [ "${saved_ip}" -eq "${used_ip}" ] && echo "good match" >=20 > 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? >=20 > Thanks for your help > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o= rg" _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you.