Created
August 16, 2016 03:58
-
-
Save subtubes-io/8b61510a107dd40296e7398d12ec7e59 to your computer and use it in GitHub Desktop.
Push to UDP from linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# attribution to http://mikeberggren.com/post/53883822425/ncudp | |
echo -n “foo” | nc -4u -w1 <host> <udp port> | |
#Here’s quick breakdown of what’s happening: | |
#-n - Tells the echo command to not output the trailing newline. | |
#-4u Use IPV4 addresses only. Use UDP instead of TCP. | |
#-w1 Silently close the session after 1 second of idle time. That way, we’re not stuck waiting for more data. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment