[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210316095131.GA18709@gondor.apana.org.au>
Date: Tue, 16 Mar 2021 20:51:31 +1100
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: rong.a.chen@...el.com, lkp@...el.com, oberpar@...ux.ibm.com,
akpm@...ux-foundation.org, kbuild-all@...ts.01.org,
linux-kernel@...r.kernel.org
Subject: Re: [kbuild-all] Re: [PATCH] gcov: fail build on gcov_info size
mismatch
Linus Torvalds <torvalds@...ux-foundation.org> wrote:
>
> See:
>
> [torvalds@...en ~]$ a="!" [ "$a" = ".size" ]
>
> is fine, but
>
> [torvalds@...en ~]$ 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@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists