[PLUG] bash test...

Dale Snell ddsnell at frontier.com
Sat Apr 23 02:25:36 UTC 2011


On Fri, 22 Apr 2011 18:52:48 -0700
Marvin Kosmal <mkosmal at gmail.com> wrote:

> What bash version are you using??
> 
> bash --version
> GNU bash, version 4.1.5(1)-release (i486-pc-linux-gnu)
> Copyright (C) 2009 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> 
> This is free software; you are free to change and redistribute
> it. There is NO WARRANTY, to the extent permitted by law.
> 
> 
> 
> HTH
> 
> Marvin
> 
> 
> On 4/22/11, Robert Citek <robert.citek at gmail.com> wrote:
> > Works for me:
> >
> > $ EBS="/net/dbvol"
> >
> > $ if [ "${EBS}" == "/net/dbvol" ]; then echo yes ;else echo
> > no ; fi yes
> >
> > $ EBS="/net/dbvolx"
> >
> > $ if [ "${EBS}" == "/net/dbvol" ]; then echo yes ;else echo
> > no ; fi no
> >
> > I suspect the error is elsewhere.
> >
> > Regards,
> > - Robert
> >
> > On Fri, Apr 22, 2011 at 5:26 PM, Russell Johnson
> > <russ at dimstar.net> wrote:
> >> Does anyone see why I get "Unexpected Operator" with the
> >> following:
> >>
> >> if [ "${EBS}" == "/net/dbvol" ]; then
>

Works for me here, too.  Here's what my bash has to say for itself
$ bash --version
GNU bash, version 4.1.7(1)-release (x86_64-redhat-linux-gnu)

According to the bash man page, "==" is both an arithmetic and
a string equivalence operator.

--Dale

--
"Every day, people around here start talking more and more like Kosh."



More information about the PLUG mailing list