Bash Binding

By Daniel Lundin:

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

Note: this actually works. It acts as a PUSH or DEALER socket, sending one message to a PULL or ROUTER or DEALER socket. It implements the 0MQ wire level protocol.