2 ms·
Just this night I was thinking if whether tmux scripting could be abused to get it to work like zmodem. Sending files from the system with the tmux session to
by tjoff 7y ago
Just this night I was thinking if whether tmux scripting could be abused to get it to work like zmodem. Sending files from the system with the tmux session to whatever machine one had sshd into (and ideally the other direction as well).
Anyone know of this or a better approach?
- tyingq 7y agoTmux has pipe-pane, and it has -I and -O to go both directions. It does require some gyrations to get around the fact that it logs everything (the command itself, terminal control, etc), and not just what's output by the command. Here's a quick and dirty example: a) Start a tmux session to a remote host b) On the local host, run this (assuming session 0): $ tmux pipe-pane -o -t0 "tail -n +2 | col -b | base64 -d > ~/output" $ tmux send-keys -t0 "base64 /some/file && read" Enter $ tmux pipe-pane -t0 $ tmux send-keys -t0 Enter You should now have ~/output on the local host, which is identical to /some/file on the remote.
- tjoff 7y agoThank you, that is great! Will certainly play around with that :)