How to stream tmux pipe-pane via UDP

2019-04-16 15:06发布

问题:

I'm trying to simultaneously save the output from a tmux pane to file and stream it using netcat.

What works:

tmux pipe-pane -o -t "server" "tee -a '/home/csgoserverp/test.txt'"
echo -n "Hello World" | tee -a '/home/me/text.txt' | nc -4u -w1 0.0.0.0 9999

What does not work:

tmux pipe-pane -o -t "server" "nc -4u -w1 0.0.0.0 9999"
tmux pipe-pane -o -t "server" "tee -a '/home/me/test.txt' | nc -4u -w1 0.0.0.0 9999"

Any help would be appreciated.

回答1:

I read somewhere that ncat is better than netcat and for reasons unknown using ncat works:

tmux pipe-pane -t "server" "tee -a '/home/csgoserverp/test.txt' | ncat -4u -w1 0.0.0.0 9999"