The sender opens a port for a 1, doesn't do anything to send a 0. Obviously, the receiver should know the sender's IP address. Usage on the receiver's side: $ ./receive.sh Usage on the sender's side: $ echo 010101110110110 | ./send.sh