You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
We need to decide what parts of normal assignment we want to implement, if any.
Example:
Exceptions are "special builtins" in POSIX mode:
For these commands, the assignments are not just local to the command, but to the whole shell.
The text was updated successfully, but these errors were encountered: