Skip to content

Instantly share code, notes, and snippets.

@FedericoCeratto
Forked from olvesh/ssh-multi.sh
Last active December 31, 2015 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FedericoCeratto/8042933 to your computer and use it in GitHub Desktop.
Save FedericoCeratto/8042933 to your computer and use it in GitHub Desktop.
# ssh-multi
# Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html
# a script to ssh multiple servers over multiple tmux panes
multimux() {
readarray hosts < "$1"
tmux new-window "ssh $1@${hosts[0]}"
unset hosts[0];
for i in "${hosts[@]}"; do
tmux split-window -h "ssh $i"
tmux select-layout tiled > /dev/null
done
tmux select-pane -t 0
tmux set-window-option synchronize-panes on > /dev/null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment