The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: rong.a.chen@intel.com, lkp@intel.com, oberpar@linux.ibm.com,
	akpm@linux-foundation.org, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org
Subject: Re: [kbuild-all] Re: [PATCH] gcov: fail build on gcov_info size mismatch
Date: Tue, 16 Mar 2021 20:51:31 +1100	[thread overview]
Message-ID: <20210316095131.GA18709@gondor.apana.org.au> (raw)
In-Reply-To: <CAHk-=wji=we4HQ2m6Z=fnUSM4UW8+X0eTnb9YPGYdcTqpVAL2Q@mail.gmail.com>

Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
> See:
> 
>   [torvalds@ryzen ~]$ a="!" [ "$a" = ".size" ]
> 
> is fine, but
> 
>   [torvalds@ryzen ~]$ a="!" [ $a = ".size" ]
>   -bash: [: =: unary operator expected

This isn't doing what you think it's doing.  The first assignment
to a is not in effect when the shell is expanding $a so what you're
actually running is

	a="!" [ = .size ]

Which is why it bombs out.

To get the desired result you need a semicolon:

$ a="!"; [ $a = ".size" ]
$ 

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

      parent reply	other threads:[~2021-03-16  9:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-11 13:03 [PATCH] gcov: fail build on gcov_info size mismatch Peter Oberparleiter
2021-03-11 18:38 ` Linus Torvalds
2021-03-12 17:46   ` Peter Oberparleiter
2021-03-11 19:33 ` kernel test robot
2021-03-11 20:02   ` Linus Torvalds
2021-03-12  3:49     ` [kbuild-all] " Rong Chen
2021-03-12 17:52       ` Linus Torvalds
2021-03-15  2:31         ` Rong Chen
2021-03-15 19:12           ` Linus Torvalds
2021-03-15 20:32             ` Jamie Heilman
2021-03-15 20:57               ` Linus Torvalds
2021-03-15 23:09                 ` Herbert Xu
2021-03-15 23:22                   ` Linus Torvalds
2021-03-16  9:51         ` Herbert Xu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210316095131.GA18709@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=akpm@linux-foundation.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oberpar@linux.ibm.com \
    --cc=rong.a.chen@intel.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox