Skip to content

Instantly share code, notes, and snippets.

@ruudud
Created June 19, 2014 13:09
Show Gist options
  • Save ruudud/bd75a332eb4ba13e5356 to your computer and use it in GitHub Desktop.
Save ruudud/bd75a332eb4ba13e5356 to your computer and use it in GitHub Desktop.
Poor-mans cssh
#!/bin/bash
# Based on https://github.com/dennishafemann/tmux-cssh/blob/master/tmux-cssh
tmux_session_name="multissh"
tmux new-session -d -s "${tmux_session_name}" "ssh $1"
shift
hosts="${@}"
for host in ${hosts[@]}; do
tmux split-window -h -t "${tmux_session_name}" "ssh ${host}"
done
# Set pane synchronisation
tmux set-window-option -t "${tmux_session_name}" synchronize-panes on
# Attach to tmux session
tmux attach-session -t "${tmux_session_name}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment