Ok. Unix nerds. Tell me your most obscure, interesting, or downright weird abuse of pipes. Bonus points for using tee and named pipes. Please if possible give the whole command (redact file names if necessary).

I'm teaching some people about what you can do on the UNIX command line and I need more examples.

@quixoticgeek

At work, our normal setup has a comm manager, which sends UDP packets to a data radio to be transmitted. In one instance, we needed one comm manager to send to two radios. Unable to configure the comm manager to send duplicate messages, we came up with this. It listens for UDP packets and sends any packets it receives to two different destinations.

socat - udp4-listen:$S_RX,bind=$S_IP,fork | tee >(socat - udp-sendto:$R1_IP:$R1_RX) | socat - udp-sendto:$R2_IP:$R2_RX

Sign in to participate in the conversation
(void *) social site

(void*)