Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Jun 2013 12:00:06 -0700
From:      <dteske@freebsd.org>
To:        <lconrad@go2france.com>, <freebsd-questions@freebsd.org>
Cc:        dteske@freebsd.org
Subject:   RE: Bourne shell "if" syntax
Message-ID:  <121901ce660c$b95d4020$2c17c060$@freebsd.org>
In-Reply-To: <121701ce660c$9a9aa5b0$cfcff110$@freebsd.org>
References:  <51b620a6.42f.2b6a6400.5605dcf0@go2france.com> <121701ce660c$9a9aa5b0$cfcff110$@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help


> -----Original Message-----
> From: Devin Teske [mailto:devin.teske@fisglobal.com] On Behalf Of
> dteske@freebsd.org
> Sent: Monday, June 10, 2013 11:59 AM
> To: lconrad@go2france.com; freebsd-questions@freebsd.org
> Cc: Devin Teske
> Subject: RE: Bourne shell "if" syntax
> 
> 
> 
> > -----Original Message-----
> > From: owner-freebsd-questions@freebsd.org [mailto:owner-freebsd-
> > questions@freebsd.org] On Behalf Of lconrad@go2france.com
> > Sent: Monday, June 10, 2013 11:53 AM
> > To: freebsd-questions@freebsd.org
> > 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
> >
> >
> > _______________________________________________
> > 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"
> 
> _____________
> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?121901ce660c$b95d4020$2c17c060$>