On 2024-03-28 3:38 p.m., Pádraig Brady wrote:
Yes the feature has merit, and was previously discussed at:
https://lists.gnu.org/archive/html/coreutils/2021-10/msg00001.html
There are some subtleties to consider though.

Indeed there are subtleties to consider. Thank you pointing previous discussion.

For the first revision, it can be stricter but leave room for improved features later without breaking backwards compatibility.

1. Support empty lines comments in separate lines.

    <optional whitespace># comment text

2. No inline comments. header1 is not a comment

    URL=https://foo.example.com#header1

3. Literal $ should be escaped. otherwise error. No variable or parameter substitution.

error for now:

    PATH=$PTH1:/foo/bar

ok:

    PRICE=\$42.05

4. Literal backslah (\) should be escaped. Otherwise error

error:

    DESCRIPTION=lorem ipsum \

     lorem ipsum

ok. value set is "lorem ipsum\nlorem ipsum". new line not expanded.

    DESCRIPTION=lorem ipsum \\nlorem ipsum

5. Command line overrides value in file. duplicate entries in file are error.

error:

    USER=foo

    USER=bar

Also error? Not allow duplicates with different cases.

    USER=foo

    User=bar

6. Only [a-zA-Z0-9_] in variable keys. any utf-8 in values.


Let me know your thoughts.

--
Regards,
Bala


Reply via email to