Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Jun 2013 14:03:10 -0500
From:      Tim Daneliuk <tundra@tundraware.com>
To:        lconrad@go2france.com
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Bourne shell "if" syntax
Message-ID:  <51B622EE.2090002@tundraware.com>
In-Reply-To: <51b620a6.42f.2b6a6400.5605dcf0@go2france.com>
References:  <51b620a6.42f.2b6a6400.5605dcf0@go2france.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 06/10/2013 01:53 PM, lconrad@go2france.com wrote:
>
>
> 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
>


Try this instead and see if this fixes it:

    if  [  _"$PTR"  ==  _  ]  ;  then



-----------------------------------------------------------------------
Tim Daneliuk



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?51B622EE.2090002>