From owner-freebsd-questions@FreeBSD.ORG Thu Jan 24 18:29:51 2013 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 84D08F3B for ; Thu, 24 Jan 2013 18:29:51 +0000 (UTC) (envelope-from vrwmiller@gmail.com) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com [209.85.217.170]) by mx1.freebsd.org (Postfix) with ESMTP id 18B2ACF1 for ; Thu, 24 Jan 2013 18:29:50 +0000 (UTC) Received: by mail-lb0-f170.google.com with SMTP id ge1so4112320lbb.29 for ; Thu, 24 Jan 2013 10:29:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=FFjMnzz32ameCJz/6hqH6Qp9s6VcD4NTahzF0VYb+Kg=; b=b7VOXLZpQwcCnUYv5r77DrCV0DscEIxWInIRRGCPZEwqMu19oI4j2E1Q1tHLI63RXy hJhDbq3fwhtGwrMeID1IKVPoccgVxMuC8klnlZyjCzx2aOIeAg4sahNlLAInEf6jyzHT HVjpeckfPwlMAXgF0aUwY4MCvr0QXPoiv3HEDyOTtRJv8Mx2v5sgGXPViTWIe5S76MEa pSQCQm7WA5whaGgDxxud8nY/B0GRA/Xq0FHh5jBZwiBrBM1slWcbN4P041R7fvkSN0yq O400V0E6eq8H06qdnvvYwFfoBO5V/41RylEhrfCbO9IkgvcylkSCzSXxbdpxkIv6mW01 R8Xw== MIME-Version: 1.0 X-Received: by 10.152.144.38 with SMTP id sj6mr2691353lab.48.1359052189872; Thu, 24 Jan 2013 10:29:49 -0800 (PST) Sender: vrwmiller@gmail.com Received: by 10.112.3.68 with HTTP; Thu, 24 Jan 2013 10:29:49 -0800 (PST) In-Reply-To: <5101786C.3070209@a1poweruser.com> References: <5101786C.3070209@a1poweruser.com> Date: Thu, 24 Jan 2013 13:29:49 -0500 X-Google-Sender-Auth: 7z8AG3kNry8ivwz-1Y4mGP1Hunw Message-ID: Subject: Re: sh script ? From: Rick Miller To: Fbsd8 Content-Type: text/plain; charset=ISO-8859-1 Cc: FreeBSD questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2013 18:29:51 -0000 On Thu, Jan 24, 2013 at 1:07 PM, Fbsd8 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? The -eq operator is used to compare integers. When comparing strings, use the == operator. -- Take care Rick Miller