Bourne shell "if" syntax

lconrad at go2france.com lconrad at go2france.com
Mon Jun 10 18:59:11 UTC 2013



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




More information about the freebsd-questions mailing list