[zeromq-dev] Bash Binding

Evan Gates evan.gates at gmail.com
Sat Nov 23 01:26:14 CET 2013

I came across the Bash Binding here http://zeromq.org/bindings:bash

zmq_push () { m=$(cat) && echo \
    -e $(printf '\\x01\\x00\\x%02x\\x00%s' \
    $((1 + ${#m})) "$m") | nc -q1 $@; }

and I was slightly horrified. Awesome idea, scary implementation. It
can't handle null bytes, messages over 254 bytes, and uses a non
standard tool (nc). So I decided to spruce it up a bit for fun.

I looked into creating a complete ZMQ implementation but bash doesn't
support listening sockets yet.




More information about the zeromq-dev mailing list