The simplest example is the following:
echo -e "\n\n\n" > /dev/udp/192.168.45.45/9875
Looking at this with tcpdump, it's actually sending 4 packets. If I needed to send a single packet consisting of hex (payload) 0a0a0a, is that possible using the /dev/udp device?
I tried this and it appears to send just a single packet of four (=trailing newline included) characters:
echo -e "\n\n\n" >/tmp/foo
cat /tmp/foo > /dev/udp/10.211.55.9/42000
The problem appears to be in echo instead of /dev/udp.
Hope this helps. Hannu
You can eliminate the final \n with -n option:
echo -n -e "\n\n\n" > /dev/udp/192.168.45.45/9875
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With