sh script ?

Teske, Devin Devin.Teske at fisglobal.com
Thu Jan 24 18:28:48 UTC 2013


Use = for string comparison with the [ built-in and -eq for numerical comparison.

-- 
Devin

On Jan 24, 2013, at 10:07 AM, Fbsd8 <fbsd8 at 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 at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at 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.


More information about the freebsd-questions mailing list