Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jun 2013 09:10:15 +0200
From:      Christoph Kukulies <kuku@kukulies.org>
To:        lconrad@go2france.com
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Bourne shell "if" syntax
Message-ID:  <51B6CD57.1030908@kukulies.org>
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 10.06.2013 20:53, lconrad@go2france.com wrote:
>
>
> script fragment:
>
> PTR=`dig @some.dns +short +norec -x a.b.c.d`
>
> echo "$PTR"
>
> if  [  "$PTR"  ==  ""  ]  ;  then


Use something like (== is wrong, btw.)

#!/bin/sh

if [ "X$1" = "X" ] ; then
    echo foo
fi


--
Christoph

>
> 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
>
>
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to 
> "freebsd-questions-unsubscribe@freebsd.org"




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