Use = for string comparison with the [ built-in and -eq for numerical comparison.
-- Devin On Jan 24, 2013, at 10:07 AM, Fbsd8 <[email protected]> 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 > _______________________________________________ > [email protected] mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "[email protected]" _____________ 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. _______________________________________________ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[email protected]"
