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

[DECISION] Assignments preceding a command are only applied for the duration of the command following it - with exceptions #169

Open
itislu opened this issue Feb 9, 2024 · 1 comment
Assignees
Labels
help needed Extra attention is needed optional feature Cool but not mandatory feature

Comments

@itislu
Copy link
Collaborator

itislu commented Feb 9, 2024

We need to decide what parts of normal assignment we want to implement, if any.

Example:

bash-5.1$ HOME=/ cd
bash-5.1$ pwd
/
bash-5.1$ echo $HOME
/nfs/homes/ldulling

Exceptions are "special builtins" in POSIX mode:

  • export
  • exit
  • unset

For these commands, the assignments are not just local to the command, but to the whole shell.

@itislu itislu added the help needed Extra attention is needed label Feb 9, 2024
@itislu itislu changed the title [UNSOLVED] Research what VAR=123 export VAR means and why VAR=123 export && echo $VAR does not work [DECISION] Assignments preceding a command are only applied for the duration of the command following it - with exceptions Feb 12, 2024
@itislu
Copy link
Collaborator Author

itislu commented Jul 17, 2024

I now have the opinion that it's fine to treat our builtins like normal, non-POSIX bash does it.
All the POSIX special builtins are commands that seem to handle things that any programming language has built-in.
For these I think it makes sense that, if you do an assignment before f.e. return, you want the assignment to stay.

However, since we don't implement shell scripts, there's really no need to make those 3 builtins that would be affected in a special way.

@itislu itislu self-assigned this Jul 17, 2024
@itislu itislu added the optional feature Cool but not mandatory feature label Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help needed Extra attention is needed optional feature Cool but not mandatory feature
Projects
Status: Backlog
Development

No branches or pull requests

1 participant