From owner-freebsd-questions@FreeBSD.ORG Mon Jun 10 18:59:11 2013 Return-Path: Delivered-To: freebsd-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 2D022F33 for ; Mon, 10 Jun 2013 18:59:11 +0000 (UTC) (envelope-from lconrad@go2france.com) Received: from omx1.hctc.net (omx1.hctc.net [69.4.62.74]) by mx1.freebsd.org (Postfix) with ESMTP id 149B31AE3 for ; Mon, 10 Jun 2013 18:59:10 +0000 (UTC) Received: from hctc.net (unknown [69.4.62.44]) by omx1.hctc.net (Postfix) with ESMTP id 622C711462 for ; Mon, 10 Jun 2013 13:53:31 -0500 (CDT) X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=69.4.54.186; From: lconrad@go2france.com To: Subject: Bourne shell "if" syntax Date: Mon, 10 Jun 2013 13:53:26 -0500 Message-ID: <51b620a6.42f.2b6a6400.5605dcf0@go2france.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Originating-IP: 69.4.54.186 X-Mailer: SurgeWeb - Ajax Webmail Client X-Authenticated-User: lconrad@go2france.com 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: Mon, 10 Jun 2013 18:59:11 -0000 script fragment: PTR=`dig @some.dns +short +norec -x a.b.c.d` echo "$PTR" if [ "$PTR" == "" ] ; then echo "$PTR" >> /path/to/PTR_absent.txt fi =========== output for an IP: a-b-c-d.domain.net. [: a-b-c-d.domain.net.: unexpected operator thanks Len