[oe] Use of == in shell scripts

Chris Larson clarson at kergoth.com
Tue Oct 26 16:03:55 UTC 2010


On Tue, Oct 26, 2010 at 8:51 AM, Maupin, Chase <chase.maupin at ti.com> wrote:

> > -----Original Message-----
> > From: openembedded-devel-bounces at lists.openembedded.org
> > [mailto:openembedded-devel-bounces at lists.openembedded.org] On Behalf Of
> > Andreas Oberritter
> > Sent: Tuesday, October 26, 2010 10:31 AM
> > To: openembedded-devel at lists.openembedded.org
> > Subject: [oe] Use of == in shell scripts
> >
> > Dear all,
> >
> > I noticed a common mistake in various OE recipes, classes and contrib
> > scripts: Instead of =, == is used as equality operator, in at least 91
> > places in 64 files (without recipes/obsolete: 83 in 60 files). This
> > isn't a problem with bash, but it isn't the standard syntax and at least
> > dash does not support it.
>
> Isn't bash the supported shell?  If I remember correctly in bash "==" will
> also work with numbers whereas "=" is only for strings.


For now, it's required, but not by our choice.  We were forced to it due to
portability issues with scripts in the buildsystems of things we build.
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics



More information about the Openembedded-devel mailing list