Skip to content

Instantly share code, notes, and snippets.

@raggi
Created May 18, 2012 17:22
Show Gist options
  • Save raggi/2726539 to your computer and use it in GitHub Desktop.
Save raggi/2726539 to your computer and use it in GitHub Desktop.
ZeroMQ push in ZSH
#!/usr/bin/env zsh
set -e
autoload -U tcp_open
tcp_open $1 $2 zmq
msg=$(cat -)
tcp_send -s zmq $(print -nf '\x01\x00\x%02x\x00%s' $((1 + ${#msg})) "$msg")
tcp_close zmq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment