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 = for string comparison with the [ built-in and -eq for numerical comparison.

-- 
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
> 
>   [ "${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?
> 
> 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.org"

_____________
The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review 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>