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
add friendly stdout and stderr redirection &> #6192
Comments
For those watching along at home, #689 asked for the same thing, but was closed as a duplicate of #110 because that was just titled "Syntax improvements for redirection & pipes". However it was then closed because the only thing that was really asked for was a way to pipe stderr and stdout together, which is now possible with Personally, I don't think this is useful often enough to warrant yet more syntax, but if anyone else thinks it's important enough to implement, go ahead. |
hi @faho it's one less barrier to adoption of a new shell. if bash and zsh support it why not fish. I am a long time bash user considering a new shell, and the more changes I have to make to my existing conf files the less likely I am to make the switch. plus it's a much more intuitive syntax. |
Fish is neither bash nor zsh. It's different, on purpose. |
oh sure, but it's still a shell right? so why not make it easier to switch? |
I think what bash and zsh came up with here is pretty reasonable. Redirecting both stdout and stderr to one place is a common enough task. For a new shell user
|
fish has pretty much bought into the bash syntax for redirections already, so I think it makes sense to match this. |
I guess that means we can also support |
We're moving away from ^ as a stderr redirection ( |
I'm OK with this since & is already a reserved character. |
Closed by #6206? |
Yep. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I actually just tried that! But my original line doesn't seem to work anymore. The original line btw was Maybe it has something to do with the |
What happens? What do you want to happen? Typically closing the file descriptor is strictly wrong (as in the program will fail or crash because of it) or doesn't matter. It fixing things is quite unexpected. |
Okay, I think I got it. You want to silence just stderr. In that case use Because the bit that signifies "close the file descriptor" is "&-", not just "-", and the This entire issue is of no interest to you (and wasn't to the first person to mention |
Yeah, sorry for taking this so off-topic. It was a shell prompt I found a long time ago. But even when just using I'll look for another shell prompt, thanks for the help anyway! |
Some context would be quite nice, then I might be able to help you. |
Well, it's getting quite confusing. I installed Somehow I seriously broke something in my fish install, but yeah |
fish, version 3.0.2
macos mojave 10.14.6 (18G103)
Darwin Kernel Version 18.7.0
xterm-256color
sh -c 'env HOME=$(mktemp -d) fish' <- does not resolve the issue
reproduction:
bash:
bash has supported the '&>' short form since version 4 and zsh supports it as well. '&>' is way easier to remember than 'cmd > file 2>&1', would be great if fish added support for it
The text was updated successfully, but these errors were encountered: