Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jan 2013 18:28:38 +0000
From:      "Teske, Devin" <Devin.Teske@fisglobal.com>
To:        Fbsd8 <fbsd8@a1poweruser.com>
Cc:        FreeBSD questions <questions@freebsd.org>
Subject:   Re: sh script ?
Message-ID:  <13CA24D6AB415D428143D44749F57D7201E9D6B1@ltcfiswmsgmb21>
In-Reply-To: <5101786C.3070209@a1poweruser.com>
References:  <5101786C.3070209@a1poweruser.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <fbsd8@a1poweruser.com> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?13CA24D6AB415D428143D44749F57D7201E9D6B1>