> -----Original Message-----
> From: Devin Teske [mailto:[email protected]] On Behalf Of
> [email protected]
> Sent: Monday, June 10, 2013 11:59 AM
> To: [email protected]; [email protected]
> Cc: Devin Teske
> Subject: RE: Bourne shell "if" syntax
> 
> 
> 
> > -----Original Message-----
> > From: [email protected] [mailto:owner-freebsd-
> > [email protected]] On Behalf Of [email protected]
> > Sent: Monday, June 10, 2013 11:53 AM
> > To: [email protected]
> > Subject: Bourne shell "if" syntax
> >
> >
> >
> > script fragment:
> >
> > PTR=`dig @some.dns +short +norec -x a.b.c.d`
> >
> > echo "$PTR"
> >
> > if  [  "$PTR"  ==  ""  ]  ;  then
> >
> 
> if [ "$PTR" = "" ]; then
> 
> or
> 
> if [ -z "$PTR" ]; then
> 
> or
> 
> if [ "$PTR" ]; then
> 

err, that should have been:

or

if [ ! "$PTR" ]; then

-- 
Devin


> but _NOT_
> 
> if [ "$PTR" == "" ]; then
> 
> --
> Devin
> 
> 
> > 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
> >
> >
> > _______________________________________________
> > [email protected] mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> > To unsubscribe, send any mail to "freebsd-questions-
> [email protected]"
> 
> _____________
> The information contained in this message is proprietary and/or confidential.
If
> you are not the intended recipient, please: (i) delete the message and all
copies;
> (ii) do not disclose, distribute or use the message in any manner; and (iii)
notify
> the sender immediately. In addition, please be aware that any message
> addressed to our domain is subject to archiving and review by persons other
than
> the intended recipient. Thank you.

_____________
The information contained in this message is proprietary and/or confidential. 
If you are not the intended recipient, please: (i) delete the message and all 
copies; (ii) do not disclose, distribute or use the message in any manner; and 
(iii) notify the sender immediately. In addition, please be aware that any 
message addressed to our domain is subject to archiving and review by persons 
other than the intended recipient. Thank you.
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[email protected]"

Reply via email to