Created
May 18, 2012 17:22
-
-
Save raggi/2726539 to your computer and use it in GitHub Desktop.
ZeroMQ push in ZSH
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 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