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

Redirects do not work correctly when reassigning std descriptors #165

Open
dundalek opened this issue Nov 10, 2019 · 0 comments
Open

Redirects do not work correctly when reassigning std descriptors #165

dundalek opened this issue Nov 10, 2019 · 0 comments

Comments

@dundalek
Copy link
Owner

In bash following prints nothing:

bash -c "echo x 1>&2" 2>/dev/null

In closh following prints x:

clojure -m closh.zero.frontend.rebel -e "echo x 1 >& 2" 2>/dev/null

I am not sure if it is possible to bend ProbessBuilder to make it work. We likely need to reach for lower level native APIs.

Some test cases:

(are [x y] (= (bash x) (closh-spawn y))
    "echo x 1>&2"
    "echo x 1 >& 2"

    "bash -c \"echo err 1>&2; echo out\" 2>&1"
    "bash -c \"echo err 1>&2; echo out\" 2 >& 1"

    "bash -c \"echo err 1>&2; echo out\" 2>&1 | cat"
    "bash -c \"echo err 1>&2; echo out\" 2 >& 1 | cat")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant