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

Surprising behavior of stderr redirections #877

Closed
ridiculousfish opened this issue Jun 16, 2013 · 2 comments
Closed

Surprising behavior of stderr redirections #877

ridiculousfish opened this issue Jun 16, 2013 · 2 comments
Milestone

Comments

@ridiculousfish
Copy link
Member

echo -n ^/tmp/temp.txt | test bad input

This sends the stderr of test to /tmp/temp.txt. The stderr redirection should have only applied to echo.

This reproduces on fish 1.x as well.

@ridiculousfish
Copy link
Member Author

I'm hopeful this can be fixed along with #110

ridiculousfish added a commit that referenced this issue Aug 20, 2013
…the redirections for a process were flattened into a big list associated with the job, so there was no way to tell which redirections applied to each process. Each process therefore got all the redirections associated with the job. See #877 for how this could manifest.

With this change, jobs only track their block-level redirections. Process level redirections are correctly associated with the process, and at exec time we stitch them together (block, pipe, and process redirects).

This fixes the weird issues where redirects bleed across pipelines (like #877), and also allows us to play with the order in which redirections are applied, since the final list is constructed right before it's needed.  This lets us put pipes after block level redirections but before process level redirections, so that a 2>&1-type redirection gets picked up after the pipe, i.e. it should fix #110

This is a significant change. The tests all pass. Cross your fingers.
@ridiculousfish
Copy link
Member Author

Ought to be fixed by 4899086

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant