Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disposition of ill-named variables #448

Open
magicant opened this issue Jan 27, 2025 · 0 comments
Open

Disposition of ill-named variables #448

magicant opened this issue Jan 27, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@magicant
Copy link
Owner

magicant commented Jan 27, 2025

Currently, VariableSet allows creating variables with any name, including an empty name and names containing the = sign. Such non-portable names may cause unexpected issues.

  • Variable names containing the = sign should not be exported as is, but the current implementation naively tries to export them.
  • The typeset, readonly, and export built-ins currently allow creating a variable with an empty name.
  • The getopts and read built-ins currently allow creating a variable with an arbitrary name, but a variable name containing the = sign results in the wrong environment variable if the all-export option is enabled.
  • The set built-in should not print variables with an invalid name. For example, export =; set prints ='' in the current implementation, but this is not a valid assignment.
@magicant magicant added this to yash-rs Jan 27, 2025
@magicant magicant converted this from a draft issue Jan 27, 2025
@magicant magicant added the bug Something isn't working label Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: To do
Development

No branches or pull requests

1 participant