Subject: Re: [PATCH 1/6] CodingGuidelines: describe "export VAR=VAL" rule

From: Andreas Schwab <[email-masked]>
Date: Sat, 06 Apr 2024 11:15:28 +0200

On Apr 06 2024, Eric Sunshine wrote:

> On Fri, Apr 5, 2024 at 8:09 PM Junio C Hamano <[email-masked]> wrote:
>> https://lore.kernel.org/git/[email-masked]/
>> resulted in 9968ffff (test-lint: detect 'export FOO=bar',
>> 2013-07-08) to add a rule to t/check-non-portable-shell.pl script to
>> reject
>>
>>         export VAR=VAL
>>
>> and suggest us to instead write it as "export VAR" followed by
>> "VAR=VAL".  This however was not spelled out in the CodingGuidelines
>> document.
>
> I suspect you meant:
>
>    ... and suggest us to instead write it as "VAR=VAL" followed by
>    "export VAR".

There is no difference between them.  The export command only marks the
variable for export, independent of the current or future value of the
variable.  The exported value is always the last assigned one.

-- 
Andreas Schwab, [email-masked]
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."