-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 both stdout and stderr of a process to the same stream #5344
Comments
I also consider using the |
I've considered this: `head -c 1000 /dev/random` |> (1,f) |> (2,f) Still needs to be made to work when the same thing is redirected to twice. |
I opened a separate issue (#5349) to track the syntax discussion, so that this one can be specific to the bug of not being able to redirect two streams into one with the current interface (of course, if the other issue is solved first, this one may be closed; I'd be surprised though). |
The following is supposed to work (@loladiro), but line 226 of open("lsout.txt", "w") do f1
run(`ls exists.txt doesnotexsist.txt`, DevNull, f1, f1)
end |
Would it be impertinent of me to suggest a 0.4 milestone for this one? |
I like putting 0.3 on stuff and see what sticks |
haha, my man 👍 |
I think I found multiple more related bugs in upstream libuv (and thus Julia's libuv) while fixing this one |
Currently, there is no operator to redirect both stderr and stdout to the same target (in bash that would be
&>
), or to collapse them before redirecting (in bash:2>&1
). I think we should come up with some general scheme for this kind of things (at some point there was an idea about using dictionaries to represent redirections), but even with what we have I was expecting to be able to do this:but this fails since it only redirects stdout.
My current workaround is this ugly hack:
Could the first attempt be made to work instead? I tried looking at the code but as soon as it goes into libuv I'm lost. So I could make a patch and put the ugly hack in place if stdout and stderr are the same, but I suppose there is a better alternative.
The text was updated successfully, but these errors were encountered: