[PATCH v6 4/7] env: Allow U-Boot scripts to be placed in a .env file

Wolfgang Denk wd at denx.de
Tue Oct 19 12:46:09 CEST 2021

Dear Simon,

In message <CAPnjgZ15KavTBZoML7dv_EaRJMyJvbA=kmY3Bgz4AeygwEppuQ at mail.gmail.com> you wrote:
> Can we just ban + ?

Why?  Just because your awk script is a lousy parser?

> In the above, foo\+ gives an unknown escape sequence from the C
> preprocessor, then the whole line is ignored by the script


-> cat foo.c
#define A ampersand
#define B berta

int foo = A \+ B ;
-> gcc -E foo.c
# 0 "foo.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "foo.c"

int foo = ampersand \+ berta ;

I do not see any such error message?

> foo+ = bar   produes a variable called "foo+ " in the environment with
> the value " bar" so you probably don't want that.

This is only because your "parser" is very primitive and sensitive
even to minimal white space changes.

> My original motivation was the complexity of getting the env you want
> using #define
> My current motivation is to complete the CONFIG migration, now in its 8th year.

I fully understand your motivation and appreciate your efforts.

Best regards,

Wolfgang Denk

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Thought for the day: What if there were no hypothetical situations?

More information about the U-Boot mailing list