help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bash ini builtin implementation feedback


From: Jesse Hathaway
Subject: Re: Bash ini builtin implementation feedback
Date: Thu, 1 Jul 2021 09:46:00 -0500

On Thu, Jul 1, 2021 at 9:38 AM Greg Wooledge <greg@wooledge.org> wrote:
> What happens if the section name is not a valid variable name?  E.g.
> if it contains a hyphen?

Good question, the code uses `legal_identifier(sec_var_name)` to
check if the section name would be a legal bash variable, if not it
throws an error. I'll add a note to that effect in the help doc:

$ ini -a conf <<'EOF'
 > [foo-bar]
 > biz = baz
 > EOF
-bash: ini: `conf_foo-bar': not a valid identifier



reply via email to

[Prev in Thread] Current Thread [Next in Thread]