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

Redirect and assign before forking in simple command #100

Closed
Tracked by #80
magicant opened this issue Oct 17, 2021 · 1 comment
Closed
Tracked by #80

Redirect and assign before forking in simple command #100

magicant opened this issue Oct 17, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@magicant
Copy link
Owner

POSIX says:

If the command name is not a special built-in utility or function, the variable assignments shall be exported for the execution environment of the command and shall not affect the current execution environment except as a side-effect of the expansions performed in step 4.

Existing shells (including C yash but not zsh) seem to allow such a side-effect to affect the current environment. For example:

a=${b=x} no_such_utility
echo a=$a b=$b

This script prints a= b=x.

To support this behavior, the shell has to perform redirections and assignments before forking a subshell.

@magicant magicant added the bug Something isn't working label Oct 17, 2021
@magicant magicant mentioned this issue Oct 17, 2021
23 tasks
@magicant
Copy link
Owner Author

Probably we should revert 7bd19e9.

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: Done
Development

No branches or pull requests

1 participant