sh script ?

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

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


On Jan 24, 2013, at 10:07 AM, Fbsd8 <fbsd8 at> wrote:

> I get this message [: 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 mailing list
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at"

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