Re: [PATCH v2] Get rid of the non portable shell export VAR=VALUE costruct
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- May 23, 2014, 18:48 UTC
- Message-ID
- <20140523184858.GF12314@google.com>
- In-Reply-To
- <xmqqegzkjq5e.fsf@gitster.dls.corp.google.com>
Hi,
Junio C Hamano wrote:
> Junio C Hamano <gitster@pobox.com> writes:
>> Makes me wonder why these two were missed, though. > > Perhaps something like this?
[...]
> - /^\s*export\s+[^=]*=/ and err '"export FOO=bar" is not portable (please use FOO=bar && export FOO)'; > + /(?:^|[^-a-zA-Z0-9_])export\s+[^=]*=/ and err '"export FOO=bar" is not portable (please use FOO=bar && export FOO)';
Messages crossed.
I think I like "\b" better for this, while I also share your lack of enthusiasm for parsing shell with something that is not a shell.
Maybe it's worth filing bugs against "posh -n" to make it (optionally?) notice things we want to detect with a goal of eventually moving to that.
Thanks, Jonathan