-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
bash' network redirection preferred over nc #90
Comments
Doesn’t seem to work on macOS |
Seems to be disabled on Debian too https://unix.stackexchange.com/a/24095 |
macOS' default shell is zsh; zsh doesn't do UDP network redirection (it does do TCP via the zsh/net/tcp module). bash is installed, but just not the default. Most Linux distros, and Windows WSL, use bash by default; Debian initially explicitly disabled this feature, but stopped doing that ca. 2009: https://sources.debian.org/src/bash/5.0-4/debian/changelog/#L611-L619. Perhaps the README should be, to cater for all platforms:
And the Alternative clients > Bash alias:
To be clear, the genuine bug is that the nc invocation fails silently when the process sending output to nc is "slow". I was sending data to anybar via the |
Done |
The method provided in the AnyBar README, using nc, has limitations when the process feeding nc's stdin is a little tardy: with the
-w0
argument, nc will not wait for input and may exit prematurely.For example, this silently doesn't work:
A workaround would be to use some arbitrarily high value for the wait argument, but fundamentally nc doesn't provide a means to associate stdin closing and closing the UDP "connection" (put another way, it doesn't have a "write only" mode). (at least one implementation of nc does provide a
-c
option that will wait for stdin to close, but it's not common)BASH provides a very useful network redirection feature, this avoids the issue and also has fewer (zero!) dependancies:
Suggest replacing the examples in the README with the BASH invocations.
The text was updated successfully, but these errors were encountered: